<?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=Tb1713</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=Tb1713"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Tb1713"/>
	<updated>2026-04-08T13:09:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508944</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508944"/>
		<updated>2015-11-06T11:36:25Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression with the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off after a certain time.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range studied was &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000 which indicate how the averaging should be performed.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire data set is calculated from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_BT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_BT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The formula above was used in the input script to calculate Cv.&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, high energy levels are already occupied, and it becomes less energetically demanding to occupy yet higher energy levels. Heat can therefore be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reasonable parameters to set for each state were determined from the phase diagram for the Lennard-Jones system:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closer together and interact. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move freely in any direction.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites on fig.15, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be found by looking at the values obtained after 2000 timesteps, after the system has equilibrated with the atoms moving randomly. This allows to calculate the diffusion coefficient for an equilibrated system with more accuracy. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; has units of &amp;lt;math&amp;gt;\frac{MSD}{timesteps}&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information than the one with tens of thousands as the results are very consistent with the simulations run on these smaller boxes. It simply smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero which is due to solids&#039; higher degree of order whereas for the liquid it directly becomes constant and equal to zero as a reference atom only interacts with its direct surrounding (cf. RDFs).&lt;br /&gt;
&lt;br /&gt;
This is very different to the harmonic oscillator&#039;s behaviour for which no energy is lost through collisions which are considered to be elastical. Therefore its VACF shows a periodic oscillation around the value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the VACF against time and by using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms. With few interactions between the atoms and therefore slower loss of energy through collisions, the vapour phase has a characteristic running integral which reaches high values and takes longer to plateau compared to the other phases.  &lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms. The running integral equilibrates after the first and only significant minimum.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms. It is very small as could be expected from the fact that the VACF against timestep initially presents periodic oscillations around the x-axis which cancel each other out.&lt;br /&gt;
&lt;br /&gt;
These diffusion coefficient values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508919</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508919"/>
		<updated>2015-11-06T11:21:23Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression with the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off after a certain time.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range studied was &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000 which indicate how the averaging should be performed.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire data set is calculated from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_BT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_BT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The formula above was used in the input script to calculate Cv.&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, high energy levels are already occupied, and it becomes less energetically demanding to occupy yet higher energy levels. Heat can therefore be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reasonable parameters to set for each state were determined from the phase diagram for the Lennard-Jones system:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closer together and interact. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move freely in any direction.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites on fig.15, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be found by looking at the values obtained after 2000 timesteps, after the system has equilibrated with the atoms moving randomly. This allows to calculate the diffusion coefficient for an equilibrated system with more accuracy. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; has units of &amp;lt;math&amp;gt;\frac{MSD}{timesteps}&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
The resulting estimated diffusion coefficients can be estimated to be &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms. More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information than the one with tens of thousands as the results are very consistent with the simulations run on these smaller boxes. It simply smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero which is due to solids&#039; higher degree of order whereas for the liquid it directly becomes constant and equal to zero as a reference atom only interacts with its direct surrounding (cf. RDFs).&lt;br /&gt;
&lt;br /&gt;
This is very different to the harmonic oscillator&#039;s behaviour for which no energy is lost through collisions which are considered to be elastical. Therefore its VACF shows a periodic oscillation around the value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the VACF against time and by using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms. It is very small as could be expected from the fact that the VACF against timestep presents periodic oscillations around the x-axis.&lt;br /&gt;
&lt;br /&gt;
These values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508914</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508914"/>
		<updated>2015-11-06T11:03:52Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression with the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off after a certain time.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range studied was &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000 which indicate how the averaging should be performed.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire data set is calculated from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_BT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_BT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The formula above was used in the input script to calculate Cv.&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, high energy levels are already occupied, and it becomes less energetically demanding to occupy yet higher energy levels. Heat can therefore be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reasonable parameters to set for each state were determined from the phase diagram for the Lennard-Jones system:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closer together and interact. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move freely in any direction.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites on fig.15, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be found by looking at the values obtained after 2000 timesteps, after the system has equilibrated with the atoms moving randomly. This allows to calculate the diffusion coefficient for an equilibrated system with more accuracy. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; has units of &amp;lt;math&amp;gt;\frac{MSD}{timesteps}&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
The resulting estimated diffusion coefficients can be estimated to be &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms. More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information than the one with tens of thousands as the results are very consistent with the simulations run on these smaller boxes. It simply smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero whereas for the liquid it directly becomes constant and equal to zero.&lt;br /&gt;
&lt;br /&gt;
This is very different to the harmonic oscillator&#039;s behaviour for which no energy is lost through collisions as they are considered to be elastical. Therefore the VACF shows a periodic oscillation around the value of 0.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the VACF against time and by using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
These values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508912</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508912"/>
		<updated>2015-11-06T10:58:44Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression with the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off after a certain time.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range studied was &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&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;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000 which indicate how the averaging should be performed.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire data set is calculated from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_BT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_BT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_B = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The formula above was used in the input script to calculate Cv.&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, high energy levels are already occupied, and it becomes less energetically demanding to occupy yet higher energy levels. Heat can therefore be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Reasonable parameters to set for each state were determined from the phase diagram for the Lennard-Jones system:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closer together and interact. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move freely in any direction.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites on fig.15, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be found by looking at the values obtained after 2000 timesteps, after the system has equilibrated with the atoms moving randomly. This allows to calculate the diffusion coefficient for an equilibrated system with more accuracy. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; has units of &amp;lt;math&amp;gt;\frac{MSD}{timesteps}&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
The resulting estimated diffusion coefficients can be estimated to be &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms. More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information than the one with tens of thousands as the results are very consistent with the simulations run on these smaller boxes. It simply smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero whereas for the liquid it directly becomes constant and equal to zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the VACF against time and by using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
These values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508878</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508878"/>
		<updated>2015-11-06T10:31:30Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be obtained by looking at the values obtained after 2000 timesteps, after the system has equilibrated. This allows to calculate the diffusion coefficient for an equilibrated system with more precision. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; has units of &amp;lt;math&amp;gt;MSD/timesteps&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
The resulting estimated diffusion coefficients can be estimated to be &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms. More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information as the result are very consistent with the simulations run on much smaller boxes. It justs smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero whereas for the liquid it directly becomes constant and equal to zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By plotting the VACF against time and using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
These values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508872</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508872"/>
		<updated>2015-11-06T10:24:59Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The mean square displacement results for each phase are given below in the respective figures. In the case of a gas, the MSD tends to increase linearly with time after a certain number of initial timesteps. A better linear fit can therefore be obtained by looking at the values obtained after 2000 timesteps, after the system has equilibrated. This allows to calculate the diffusion coefficient for an equilibrated system with more precision. It is found using the formula:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{1}{6} \frac{d&amp;lt;r^2(t)&amp;gt;}{dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The gradient found in timesteps units must be converted to time units.&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{d&amp;lt;r^2(t)&amp;gt;}{dt}&amp;lt;/math&amp;gt; as units of &amp;lt;math&amp;gt;MSD/timesteps&amp;lt;/math&amp;gt; and the timesteps used was equal to 0.002 time units, it must be divided by 0.002. &lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 3.03 and 3.02 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The liquid case presents a very clear linear trend. The mean squared displacement increases linearly with timestep as can be expected in a liquid where atoms move randomly through Brownian motion.&lt;br /&gt;
From the gradient, the resulting diffusion coefficients calculated are &amp;lt;math&amp;gt;8.49\times10^{-2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;8.73\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting estimated diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
The mean squared displacement equilibrates around an extremely small value and remains constant after as can be expected from a solid in which the atoms are fixed on specific lattice sites. &lt;br /&gt;
The resulting estimated diffusion coefficients can be estimated to be &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt; for 1 million atoms. More than these specific values, the fact that this is negligible compared to the other two cases can be retained.&lt;br /&gt;
&lt;br /&gt;
It can also be concluded that the simulation with 1 million atoms does not bring much more information as the result are very consistent with the simulations run on much smaller boxes. It justs smoothens the trends observed. It is therefore not necessary to include so many atoms in the calculations especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent a change in the direction and of the atoms resulting from a collision. After this initial minimum, the behaviour differs between the VACF of the solid and that of the liquid.&lt;br /&gt;
The VACF for the solid phase displays a decaying oscillation around the value of zero whereas for the liquid it directly becomes constant and equal to zero.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By plotting the VACF against time and using the trapezium rule, it is possible to plot the running integral under the VACF as a function of time.&lt;br /&gt;
The D value can be estimated from the final values of the running integrals which correspond to the plateau reached after a sufficient time has passed for the VACF to equilibrate around 0.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a gas, the diffusion coefficient is estimated to be 3.29 for the simulation performed or 3.27 for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a liquid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;9.8\times10^{-2}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;9.0\times10^{-2}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
For a solid, the diffusion coefficient is estimated to be &amp;lt;math&amp;gt;3.6\times10^{-5} &amp;lt;/math&amp;gt; or&amp;lt;math&amp;gt;4.6\times10^{-5}&amp;lt;/math&amp;gt; for 1 million atoms.&lt;br /&gt;
&lt;br /&gt;
These values are consistent with the ones obtained using the mean squared displacement method. Extending the calculation to 1 million atoms proves unnecessary again. While the trends are smoothened, the results obtained with a smaller set of atoms are sufficiently accurate.&lt;br /&gt;
&lt;br /&gt;
The use of the trapezium rule for integration can be thought to be a possible source of error in the final values obtained. Indeed, given that the VACFs are not periodic the error from the approximation adds up with time. More accurate mathematical integration methods could be used to refine the plot of the running integral.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508649</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508649"/>
		<updated>2015-11-06T02:39:56Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T|none]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 2.909 and 2.895&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 0.0841 and 0.0866.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms does not bring much more information. It justs smoothens the trends observed. It is therefore not necessary especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima represent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508645</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508645"/>
		<updated>2015-11-06T02:33:43Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn in fig.15 with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 2.909 and 2.895&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 0.0841 and 0.0866.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms does not bring much more information. It justs smoothens the trends observed. It is therefore not necessary especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima represent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|none|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|none|568x568px]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508644</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508644"/>
		<updated>2015-11-06T02:24:13Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Figure 2: Error against Time|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|Figure 3: Linear Fit to the Error maxima|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|Figure 5: Simple Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|Figure 6: Face Centred Cubic Lattice]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Figure 7: Equilibration of Parameters for a Timestep of 0.001|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|Figure 8: Equilibration of Parameters for a Timestep of 0.001 Close Up|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Figure 9: Energy Variation For Different Timesteps|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|Figure 10: Energy Variation For Different Timesteps Close Up|568x568px]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==RUNNING SIMULATION UNDER SPECIFIC CONDITIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|Figure 11: Plotting Equations of State|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CALCULATING HEAT CAPACITIES USING STATISTICAL PHYSICS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|Figure 12: Heat Capacity over Volume variations with Time|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Figure 13: Input File for 0.2d and 2.2T]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==STRUCTURAL PROPERTIES AND THE RADIAL DISTRIBUTION FUNCTION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|Figure 14: RDFs for Solid, Liquid, and Gas states|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn below with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|Figure 15: Lattice Sites Corresponding to Peaks]]&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|Figure 16: RDF Solid Case|568x568px]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|Figure 17: Mean Square Displacements for the Gas Phase|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 2.909 and 2.895&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Figure 18: Mean Square Displacements for the Liquid Phase|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 0.0841 and 0.0866.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|Figure 19: Mean Square Displacements for the Solid Phase|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms does not bring much more information. It justs smoothens the trends observed. It is therefore not necessary especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|Figure 20: Simulated VACFs compared to Harmonic Oscillator VACF|568x568px]]&lt;br /&gt;
&lt;br /&gt;
The minima represent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|Figure 21: VACFs and Running Integrals Gas|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|Figure 22: VACFs and Running Integrals Liquid|568x568px]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|Figure 23: VACFs and Running Integrals Solid|568x568px]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508636</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508636"/>
		<updated>2015-11-06T01:59:32Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn below with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|rdfddisisol]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|MSD Gas]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 2.909 and 2.895&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Msd Liquid]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are 0.0841 and 0.0866.  &lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|MSD Solid]]&lt;br /&gt;
&lt;br /&gt;
The resulting diffusion coefficients are &amp;lt;math&amp;gt;5.83\times10^{-7}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;4.39\times10^{-6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms does not bring much more information. It justs smoothens the trends observed. It is therefore not necessary especially as it is much more demanding in terms of computations.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(x)  cos (x)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|VACFScomp]]&lt;br /&gt;
&lt;br /&gt;
The minima represent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|VACF Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|VACF Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|VACF Solid]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508622</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508622"/>
		<updated>2015-11-06T01:38:52Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn below with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|rdfddisisol]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|MSD Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Msd Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|MSD Solid]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First, we can give an expression for the functions inside the integrals as we know how velocity depends on the position for a classical 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
The position &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; for a classical harmonic oscillator is given as seen in the Introduction section by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The velocity can be inferred: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt; as can be calculated by differentiating using the chain rule&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt;t = t + \tau &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x = Acos[\omega (t+\tau) + \phi] &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t+\tau) = -A\omega sin(\omega t + \omega\tau + \phi) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can now be inserted in the equation for &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} A \omega sin(\omega t + \phi) A \omega sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} A \omega  sin(\omega t + \phi) A \omega  sin (\omega t + \phi) \mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin [\omega t + \omega \tau + \phi]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the trigonometric identity:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(u+v) = sin(u)cos(v) + cos(u)sin(v)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can be expressed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; sin(\omega t + \omega \tau + \phi) = sin(\omega t) cos(\omega \tau + \phi) + cos(\omega t) sin(\omega \tau + \phi)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Giving:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) [sin(\omega \tau) cos (\omega t + \phi) + cos(\omega \tau) sin (\omega t + \phi)] \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi) + sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi) sin (\omega \tau) cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) cos (\omega \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + \frac{cos (\omega \tau) \int_{-\infty}^{\infty} sin^{2}(\omega t + \phi) \mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t} + cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whilst the &amp;lt;math&amp;gt; sin(\omega t + \phi) &amp;lt;/math&amp;gt; function is an unsymmetrical, hence an odd function, the &amp;lt;math&amp;gt; cos(\omega t + \phi) &amp;lt;/math&amp;gt; function is symmetrical, hence an even function. Multiplying an even function by and odd function, results in another odd function, thus leading to an integral function with a value of zero. &lt;br /&gt;
&lt;br /&gt;
With the first term &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) = \frac{sin (\omega \tau) \int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^{2}(\omega t + \phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Equal to zero as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(\omega t + \phi)  cos (\omega t + \phi)\mathrm{d}t = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Therefore&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau) =  cos (\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The VACFs from the simulations can be compared to the harmonic oscillator VACF.&lt;br /&gt;
&lt;br /&gt;
[[File:VACFScomp.PNG|thumb|VACFScomp]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|VACF Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|VACF Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|VACF Solid]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508598</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508598"/>
		<updated>2015-11-06T00:59:17Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EQUILIBRATION==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Running Simulations Under Specific Conditions==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
==Calculating Heat Capacities Using Statistical Physics==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
==Structural Properties and the Radial Distribution Function==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
For all cases, the RDF is equal to 0 for interatomic distances smaller than 0.9. This is due to the Lennard Jones repulsion term being high for very short distances which prevents any atom entering withing this range of the reference particle. &lt;br /&gt;
&lt;br /&gt;
In the gas case, only one broad peak can be observed, around a distance of 1. This confirms the gas phase displays the smallest amount of order. &lt;br /&gt;
&lt;br /&gt;
In the liquid case, three peaks with decreasing amplitudes can be observed at short distances. This shows liquids present some amount of order. This is due to interactions between atoms which though able to move are brought closed together. The parallel can be drawn with solvation shells for solutes in water. The configuration directly around the reference atom is somewhat fixed whereas the rest of the surroundings can move in any direction.&lt;br /&gt;
&lt;br /&gt;
In the solid case, peaks can be observed throughout the entire range of distances simulated. This is indicative of both short and long range order in the solid phase. The peaks, especially the first three, are also narrow and well-defined compared to what can be seen in the other cases. This is because the atoms in a solid are fixed and therefore coordination shells are found consistently at the same positions compared to the other cases which allow more movement and wider variation of the particle&#039;s positions.&lt;br /&gt;
&lt;br /&gt;
The peaks can therefore be directly related to a specific lattice sites in the face centered cubic lattice. The internuclear distances with these sites have been drawn below with the number giving their order of appearance in the RDF. The shortest corresponds to the first peak or coordination sphere and the largest to the third peak.&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
This implies that the lattice spacing is given by the second peak which corresponds to a distance of 1.825.&lt;br /&gt;
&lt;br /&gt;
[[File:RDFDissol.PNG|thumb|rdfddisisol]]&lt;br /&gt;
&lt;br /&gt;
Looking at these specific lattice sites, the coordination number of the respective peaks can therefore be determined. It is equal to 12 for the first peak, 6 for the second peak, and 24 for the third peak.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|MSD Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Msd Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|MSD Solid]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|VACF Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|VACF Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|VACF Solid]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508550</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508550"/>
		<updated>2015-11-06T00:09:56Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
In the liquid case,&lt;br /&gt;
&lt;br /&gt;
In the solid case,&lt;br /&gt;
&lt;br /&gt;
In the gas case&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|MSD Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Msd Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|MSD Solid]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|VACF Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|VACF Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|VACF Solid]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508542</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508542"/>
		<updated>2015-11-06T00:01:35Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
In the liquid case,&lt;br /&gt;
&lt;br /&gt;
In the solid case,&lt;br /&gt;
&lt;br /&gt;
In the gas case&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MSD Gas.PNG|thumb|MSD Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD LiquidTB.PNG|thumb|Msd Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:MSD SolidTB.PNG|thumb|MSD Solid]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Gas.PNG|thumb|VACF Gas]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Liquid.PNG|thumb|VACF Liquid]]&lt;br /&gt;
&lt;br /&gt;
[[File:VACF Solid.PNG|thumb|VACF Solid]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508489</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508489"/>
		<updated>2015-11-05T22:26:46Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Reduced units are used throughout all the different simulations and all the graphs presented have axis expressed in reduced units.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The parameters set for each state were:&lt;br /&gt;
&lt;br /&gt;
Gas: Density = 0.05 Temperature = 1.2&lt;br /&gt;
Liquid: Density = 0.8 Temperature =1.2&lt;br /&gt;
Solid: Density = 1.2 Temperature = 1.2&lt;br /&gt;
&lt;br /&gt;
The RDFs calculated from the trajectories for the three systems are represented below &lt;br /&gt;
&lt;br /&gt;
[[File:RDFs.PNG|thumb|RDFSsolgasliq]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function takes for reference an arbitrarily chosen atom and indicates the density of neighbouring atoms as a function of internuclear distance. It is a good way to understand the relative arrangement of atoms in each different state.&lt;br /&gt;
&lt;br /&gt;
In the liquid case,&lt;br /&gt;
&lt;br /&gt;
In the solid case,&lt;br /&gt;
&lt;br /&gt;
In the gas case&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508466</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508466"/>
		<updated>2015-11-05T22:06:17Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\timesk_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
[[File:Closeup2.PNG|thumb|closeup2]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The fix command allows us to calculate the average for any variable (thermodynamic property) previously defined. It is followed by the numbers 100 1000 100000.&lt;br /&gt;
&lt;br /&gt;
The first value corresponds to Nevery which tells the program how often (in timesteps) it must take a sample value to calculate the average for the parameter in question. &lt;br /&gt;
The second value Nrepeat gives the number of samples included in the final average. &lt;br /&gt;
Finally, Nfreq=100000 and its multiples are the values for which the average quantities will be generated.&lt;br /&gt;
&lt;br /&gt;
Since we are looking at 100000 data points this effectively means that the average over the entire calculation is calculated for each parameter from values sampled every 100 data points.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The timestep has been set to 0.0025. Simulating 100000 data points means 250 reduced time units will be simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal gas law was computed using the definition &amp;lt;math&amp;gt;pV = Nk_bT&amp;lt;/math&amp;gt; which gives &amp;lt;math&amp;gt;\frac{N}{V} =  \frac{p}{k_bT}&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;k_b = 1&amp;lt;/math&amp;gt; when performing calculations in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at any given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles are considered not to interact except when they collide elastically. This means the Lennard Jones interactions are set to zero and the &amp;lt;math&amp;gt;r^{-12}&amp;lt;/math&amp;gt; internuclear repulsion term is not taken into account. However, for the liquid simulation it is included and as a result the atoms are found further apart thus lowering the density.  &lt;br /&gt;
&lt;br /&gt;
The discrepancy increases with pressure. This is again due to the fact that in an ideal gas, particles do not interact, whereas in the liquid system simulated, the particles which are pushed closer together at high pressure repel each other more strongly. Thus the difference between the densities predicted becomes greater.  &lt;br /&gt;
&lt;br /&gt;
On a different note, increasing the temperature leads to a convergence of the values obtained  by the simulation and those predicted by the ideal gas law. Because of the increased thermal motion, the kinetic energy becomes predominant at higher temperatures. As a result, the intermolecular repulsions become more negligible meaning that the behaviour of the liquid effectively tends towards that of an ideal gas. Its density becomes proportional to the inverse of the temperature.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; increases with density at a given temperature. Indeed, the amount of energy required to increase the temperature of the system becomes higher if the system is denser, with more particles to which heat must be transferred in a given volume.&lt;br /&gt;
&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density. This is a more subtle characteristic and cannot easily be predicted from a classical treatment. Quantum mechanically, it could be thought to result from the convergence of energy levels. At higher temperatures, for which high energy levels are already occupied, it becomes less energetically demanding to occupy yet higher energy levels and therefore heat can be transferred more easily to the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508300</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508300"/>
		<updated>2015-11-05T20:36:23Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\times\k_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Cubib lattice.PNG|thumb|cubes2]]&lt;br /&gt;
&lt;br /&gt;
A simple cubic unit cell contains a single atom. With a lattice spacing of 1.07722, the unit cell has a volume &lt;br /&gt;
&amp;lt;math&amp;gt;V = 1.07722^{3} = 1.25&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore:&lt;br /&gt;
&amp;lt;math&amp;gt;\rho = \frac{1}{1.25} = 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc latt.PNG|thumb|cubes3]]&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc (4 atoms per unit cell).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass of the different atom types simulated. Here there is only one type and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut is used to calculate the Lennard-Jones potential between pairs of atoms. The cut (3.0 here) gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed. &lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm since it requires &amp;lt;math&amp;gt;x_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; v_i\left(0\right)&amp;lt;/math&amp;gt; for the computation to be initiated.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration of Parameters for a timestep of 0.001]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium for all the studied parameters after a time 0.4. This can be observed when zooming in on the relevant region of the graphs.&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
[[File:Engvartimestepcloserup.PNG|thumb|engvarcloserup]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.015 is a particularly bad choice as the system does not equilibrate and the total energy shoots off.The largest timestep to give acceptable results is 0.01. For all timesteps under this value, the simulation reaches equilibrium. However, for a better accuracy a timestep of 0.0025 is the best option since the value around which the equilibrium oscillates is slightly lower and matches that of a 0.001 timestep very closely. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at a given temperature increases with density. The amount of energy required to increase the temperature of the system is higher if the system is more dense, need to heat more particles.&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density.This could have been expected given that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Fcc lattice.PNG|thumb|cubes1]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508273</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508273"/>
		<updated>2015-11-05T20:08:13Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|Figure 1: Analytical Solution against Time|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|Figure 4:  Total Energy against Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\timesk_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at a given temperature increases with density. The amount of energy required to increase the temperature of the system is higher if the system is more dense, need to heat more particles.&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density.This could have been expected given that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508269</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508269"/>
		<updated>2015-11-05T20:03:08Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Additionally &amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial conditions given were: &amp;lt;math&amp;gt;k = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;timestep = 0.100&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;mass = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;A = 1.00&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega =1.00&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Figure 1 demonstrates the results from the velocity-Verlet alorithm for the position of the oscillator and from the classical calculation are in good agreement. &lt;br /&gt;
&lt;br /&gt;
The ERROR value gives the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. It varies periodically and is small compared to the actual values which are contained in the interval [-1,1]. It does however gain amplitude with time with the error maxima increasing linearly. The gradient of this variation of the error maxima is found to be &amp;lt;math&amp;gt;4.22\times10^{-4}&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; E = \frac {1}{2}mv^2 + \frac {1}{2}kx^2 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In an ideal harmonic oscillator, the total energy of the system can be expected to remain constant as nothing is lost to the surroundings, thus giving perpetual motion through cycles of extension and compression due to the interchange between potential and kinetic energy. It is found here that the total energy has a constant average over time. It does however oscillate slightly around this average, following a periodic sinusoidal behaviour. The oscillations are extremely small in amplitude, only 0.12% of the average value and the model can therefore be considered to be sufficiently close to the expected behaviour. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By experimenting with different timesteps, it can be found that a timestep shorter than 0.28 seconds is necessary for the total energy of the system to stay within 1% of its average value. It is important to monitor this total energy to verify that the system simulated does indeed correspond to a closed system with a constant total energy.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\sigma^{6} = r_e^{6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = 2^{\frac{1}{6}}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{2^2\sigma^{12}} - \frac{\sigma^{6}}{2\sigma^{6}} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{1}{4} - \frac{1}{2} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = -\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;3.34\times10^{22}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and the density of water which is &amp;lt;math&amp;gt;\rho = 999.8\times10^{-1} g.cm^{-3}&amp;lt;/math&amp;gt; under standard conditions.&lt;br /&gt;
&lt;br /&gt;
Using these same numbers, the volume of 10000 water molecules under standard conditions can be calculated and it is approximately &amp;lt;math&amp;gt;3.0\times10^-19mL&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09nm&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is &amp;lt;math&amp;gt;\epsilon = 120K\timesk_B&amp;lt;/math&amp;gt;. &lt;br /&gt;
So &amp;lt;math&amp;gt;\epsilon = 1.66\times10^{-21}J \simeq 1.0 kJmol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulations as it can create situations that are physically impossible and lead to absurd values. For instance, atoms could initially be placed too close to each other which given the equation for the Lennard-Jones potential could lead to extremely high energy potentials that do not actually occur in real systems. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at a given temperature increases with density. The amount of energy required to increase the temperature of the system is higher if the system is more dense, need to heat more particles.&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density.This could have been expected given that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508058</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=508058"/>
		<updated>2015-11-05T16:28:38Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
The trend observed corresponds to what could be expected. Logically, &amp;lt;math&amp;gt;\frac{C_v}{V}&amp;lt;/math&amp;gt; at a given temperature increases with density. The amount of energy required to increase the temperature of the system is higher if the system is more dense, need to heat more particles.&lt;br /&gt;
Additionally, this quantity decreases with temperature for a given density.This could have been expected given that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507870</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507870"/>
		<updated>2015-11-05T14:34:52Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CvvT.PNG|thumb|cvvtt]]&lt;br /&gt;
&lt;br /&gt;
[[File:InputFilenvt0.2d2.2t.PNG|thumb|Input File 0.2d 2.2t]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507809</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507809"/>
		<updated>2015-11-05T13:57:08Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The time step chosen is 0.0025. The two pressures chosen were &amp;lt;math&amp;gt;2.5&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;3.0&amp;lt;/math&amp;gt; and the temperature range is &amp;lt;math&amp;gt;1.5,2.0,2.5,3.0,5.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
By factorising &amp;lt;math&amp;gt;\gamma^2&amp;lt;/math&amp;gt; out of the sum and combining the two equations we find:&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The numbers 100 1000 100000&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Eqstateplot.PNG|thumb|eqstateplot]]&lt;br /&gt;
&lt;br /&gt;
The simulated density is lower than the density predicted by the ideal gas law at a given pressure and temperature. This is due to the difference between the liquid that is simulated and an ideal gas. In an ideal gas, particles do not interact except when they collide elastically. The discrepancy increases with pressure. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507764</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507764"/>
		<updated>2015-11-05T13:32:05Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115|260x260px]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507523</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507523"/>
		<updated>2015-11-04T23:23:35Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Running Simulations Under Specific Conditions&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Choose 5 temperatures (above the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points &amp;amp;mdash; five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the [http://lammps.sandia.gov/doc/fix_ave_time.html manual page] to find out the importance of the three numbers &#039;&#039;100 1000 100000&#039;&#039;. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated.  Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Calculating Heat Capacities Using Statistical Physics&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Many quantities in statistical thermodynamics can be calculated by considering how far the system is able to fluctuate from its average equilibrium state. For example, if the temperature is held &amp;quot;constant&amp;quot;, then we know that the total energy must be fluctuating. The magnitude of these fluctuations actually tell us about the heat capacity of the system, according to the equation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at &amp;lt;math&amp;gt;0.2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;, and the temperature range is &amp;lt;math&amp;gt;2.0, 2.2, 2.4, 2.6, 2.8&amp;lt;/math&amp;gt;. Plot &amp;lt;math&amp;gt;C_V/V&amp;lt;/math&amp;gt; as a function of temperature, where &amp;lt;math&amp;gt;V&amp;lt;/math&amp;gt; is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;Structural Properties and the Radial Distribution Function&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate &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;. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;DYNAMICAL PROPERTIES AND THE DIFFUSION CONSTANT&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the D subfolder, there is a file &#039;&#039;liq.in&#039;&#039; that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the &amp;quot;total&amp;quot; MSD) as a function of timestep. Are these as you would expect? Estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507509</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507509"/>
		<updated>2015-11-04T23:03:31Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:0.001equilibration.JPG|thumb|Equilibration 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium after a time &lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. However, for the best accuracy timesteps of 0.0025 are the best option. A timestep of 0.015 is a particularly bad choice as the system does not equilibrate .&lt;br /&gt;
&lt;br /&gt;
[[File:Engvariationdifftimesteps.JPG|thumb|Energy Variation For Different Timesteps]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507500</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507500"/>
		<updated>2015-11-04T22:40:57Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^{19}&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19L&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;EQUILIBRATION&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Giving atoms random coordinates can cause problems in simulation as this might create situations that are physically impossible and lead to absurd values.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The side length of a face-centred cubic lattice with a lattice point number density of 1.2 is &amp;lt;math&amp;gt;\sqrt[3]{\frac{4}{d}} = 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There would be a total of 4000 atoms created by the create_atoms command if the lattice defined was fcc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The mass command defines the mass o the different atom types simulates. Here there is only one and it is given a mass of 1.0.&lt;br /&gt;
&lt;br /&gt;
Pair_styl lj/cut gives the argument for the global cutoff for the Lennard-Jones interactions in distance units.It is the maximal distance for which the Lennard-Jones interaction between pair of atoms will be computed.&lt;br /&gt;
&lt;br /&gt;
Pair_coeff is used to specify the pairwise force field coefficients. The asterix is here to signify this applies to all pairs of atoms (and atom types, only one here) present in the box.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The integration algorithm that will be used is the velocity Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This makes it easier to change the timestep in future copies of the code. The variable&#039;s value can simply be changed in the line where the variable is defined. All other lines which call this value will not need to be updated as they call the variable to which the new value is attached. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507477</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507477"/>
		<updated>2015-11-04T22:06:11Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = \sqrt{(\frac{k}{m})} = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^19&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19&amp;lt;/math&amp;gt;L.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40J&amp;lt;/math&amp;gt; for one pair of atoms. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180K &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507470</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507470"/>
		<updated>2015-11-04T21:56:51Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(\frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
There are approximately &amp;lt;math&amp;gt;2.4\times10^19&amp;lt;/math&amp;gt; molecules in 1mL of water under standard conditions. This is calculated using Avogadro&#039;s number and a molar volume for water of &amp;lt;math&amp;gt;V_m = 24.790 dm^3/mol&amp;lt;/math&amp;gt; at 25°C.&lt;br /&gt;
&lt;br /&gt;
The volume of 10000 water molecules under standard conditions is approximately &amp;lt;math&amp;gt;4.12\times10^-19&amp;lt;/math&amp;gt;L.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
After the periodic boundary conditions have been applied, this atom ends up at position &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;r = r^*\times\sigma = 1.09&amp;lt;/math&amp;gt;nm.&lt;br /&gt;
The well depth is therefore &amp;lt;math&amp;gt;\phi\left(r\right) = -0.40&amp;lt;/math&amp;gt;J for one pair of atoms &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T = 120T^* = 180 &amp;lt;/math&amp;gt;K&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507437</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507437"/>
		<updated>2015-11-04T21:14:14Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(\frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(\frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.008&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.003 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507432</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507432"/>
		<updated>2015-11-04T21:09:09Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(\frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out to give a zero potential energy.&lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation &amp;lt;math&amp;gt;\r_e&amp;lt;/math&amp;gt; for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r_e}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_e^{13}} = \frac{6\sigma^6}{r_e^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_e^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{7}{6}}2^{\frac{1}{6}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi\left(r_e\right) = 4\epsilon\left(frac{\sigma^\frac{29}{6} - \sigma^\frac{65}{6}}{2^\frac{1}{6}}\right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Evaluating integrals : &lt;br /&gt;
 &lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r \simeq -0.025 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507422</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507422"/>
		<updated>2015-11-04T20:52:35Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(\frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out. &lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{r_eq^{13}} = \frac{6\sigma^6}{r_eq^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = r_eq^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_eq = -\sigma^{\frac{6}{6}}*2^{\frac{1}{6}}&amp;lt;/center&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507420</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507420"/>
		<updated>2015-11-04T20:45:52Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(\frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out. &lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_0)=\frac{24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation for which &amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left( \frac{12\sigma^{12}}{\r_eq^{13}} = \frac{6\sigma^6}{\r_eq^{7}} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sigma^{-7} = \r_eq^{-6}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507411</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507411"/>
		<updated>2015-11-04T20:36:24Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(frac{k}{m}) = \frac{2\pi}{T} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out. &lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
with &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_0)=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation for which &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507410</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507410"/>
		<updated>2015-11-04T20:33:48Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = &amp;lt;msqrt&amp;gt;&amp;lt;mi&amp;gt;\frac{k}{m}&amp;lt;/mi&amp;gt;&amp;lt;/msqrt&amp;gt; = 2\pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out. &lt;br /&gt;
&lt;br /&gt;
The force is given by &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{\r}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;- \frac{\mathrm{d}\phi\left(\mathbf{\r}\right)}{\mathrm{d}\mathbf{r}} = 4\epsilon \left( \frac{12\sigma^{12}}{r^{13}} - \frac{6\sigma^6}{r^7} \right)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
with &amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_0)=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is the separation for which &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507406</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507406"/>
		<updated>2015-11-04T20:23:37Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = √(k/m) = 2\pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_0=\sigma&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;&amp;lt;/math&amp;gt; is the separation at which the &amp;lt;math&amp;gt;r^-12&amp;lt;/math&amp;gt; term corresponding to short range repulsion and the &amp;lt;math&amp;gt;r^-6&amp;lt;/math&amp;gt; term corresponding to long range attraction between the pair of atoms cancel each other out. At this separation, the force is &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\mathbf{F} = - \frac{\mathrm{d}\phi\left(\mathbf{\sigma}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\mathrm{d}\phi\left(\mathbf{\sigma}\right)}{\mathrm{d}\mathbf{r}}&amp;lt;/math&amp;gt; = 4\epsilon \left( \frac{6\sigma^{6}}{r^{7}} - \frac{12\sigma^12}{r^13} \right)&amp;lt;/center&amp;gt;&lt;br /&gt;
with &amp;lt;math&amp;gt;r_0 = \sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_0)=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507399</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507399"/>
		<updated>2015-11-04T19:58:14Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507397</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507397"/>
		<updated>2015-11-04T19:53:47Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507392</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507392"/>
		<updated>2015-11-04T19:32:13Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK:&amp;lt;/big&amp;gt; For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of &amp;lt;math&amp;gt;10000&amp;lt;/math&amp;gt; water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied&#039;&#039;?&#039;&#039;&#039;.&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of &amp;lt;math&amp;gt;0.8&amp;lt;/math&amp;gt;. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Using the [http://lammps.sandia.gov/doc/Section_commands.html#cmd_5 LAMMPS manual], find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Look at the lines below.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a &#039;&#039;particularly&#039;&#039; bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;&amp;lt;span style=&amp;quot;color:blue; &amp;quot;&amp;gt;This is the third section of the third year simulation experiment. You can return to the previous page, [[Third_year_simulation_experiment/Introduction_to_molecular_dynamics_simulation|Introduction to molecular dynamics simulation]], or jump ahead to the next section, [[Third year simulation experiment/Running simulations under specific conditions|Running simulations under specific conditions]].&amp;lt;/span&amp;gt;&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507377</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507377"/>
		<updated>2015-11-04T19:05:56Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction, \phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right), find the separation, r_0, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r_{eq}, and work out the well depth (\phi\left(r_{eq}\right)). Evaluate the integrals \int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r, \int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r, and \int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r when \sigma = \epsilon = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position \left(0.5, 0.5, 0.5\right) in a cubic simulation box which runs from \left(0, 0, 0\right) to \left(1, 1, 1\right). In a single timestep, it moves along the vector \left(0.7, 0.6, 0.2\right). At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are \sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}. If the LJ cutoff is r^* = 3.2, what is it in real units? What is the well depth in \mathrm{kJ\ mol}^{-1}? What is the reduced temperature T^* = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507376</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507376"/>
		<updated>2015-11-04T19:04:25Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt;. &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction, \phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right), find the separation, r_0, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, r_{eq}, and work out the well depth (\phi\left(r_{eq}\right)). Evaluate the integrals \int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r, \int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r, and \int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r when \sigma = \epsilon = 1.0.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position \left(0.5, 0.5, 0.5\right) in a cubic simulation box which runs from \left(0, 0, 0\right) to \left(1, 1, 1\right). In a single timestep, it moves along the vector \left(0.7, 0.6, 0.2\right). At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are \sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}. If the LJ cutoff is r^* = 3.2, what is it in real units? What is the well depth in \mathrm{kJ\ mol}^{-1}? What is the reduced temperature T^* = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
EQUILIBRATION&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507371</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507371"/>
		<updated>2015-11-04T18:56:45Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2Pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated by summing the potential and kinetic energy of the system. &lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507368</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507368"/>
		<updated>2015-11-04T18:53:08Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = √(k/m) = 2π/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ENERGY value is calculated&lt;br /&gt;
&lt;br /&gt;
The ERROR value is the difference between the ANALYTICAL value and x(t), the position given by the velocity-Verlet algortihm at time t. &lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507361</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507361"/>
		<updated>2015-11-04T18:46:40Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = √(k/m) = 2π/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507357</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507357"/>
		<updated>2015-11-04T18:43:05Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INTRODUCTION TO MOLECULAR DYNAMICS SIMULATIONS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
The ANALYTICAL value is calculated using the full steady state equation of the harmonic oscillator motion &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt; A = 1 &amp;lt;/math&amp;gt; &amp;lt;math&amp;gt; \omega = 1 &amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt; \phi = 0 &amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \omega = sqrt(k/m) = 2pi/T &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. With the timestep default value of 0.1 it is within 0.13% of its average value. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507350</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507350"/>
		<updated>2015-11-04T18:27:34Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Energy.PNG|thumb|energyTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical.PNG|thumb|analyticalTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima.PNG|thumb|errmaxTBLS1115]]&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507344</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507344"/>
		<updated>2015-11-04T18:20:55Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;br /&gt;
&lt;br /&gt;
With a timestep shorter than 0.28 seconds, the total energy of the system does not change by more than 1%. It is important to monitor the total energy of a physical system because the behaviour of the system depends on its kinetic and potential energy and the interchange between the two. If the system modelled is closed it is important to verify that the total energy does not vary too significantly which it should not.&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507335</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507335"/>
		<updated>2015-11-04T18:10:25Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Error fit TBLS1115.PNG|thumb|Error fit]]&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507326</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507326"/>
		<updated>2015-11-04T18:03:32Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt; x(t) = Acos(\omega t + \phi) &amp;lt;/math&amp;gt; (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507325</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=507325"/>
		<updated>2015-11-04T18:02:36Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  x\left(t\right) = A\cos\left(\omega t + \phi\right) (the values of A, \omega, and \phi are worked out for you in the sheet).&lt;br /&gt;
&lt;br /&gt;
TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&lt;br /&gt;
&lt;br /&gt;
TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t = \phi) &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=506617</id>
		<title>Rep:Mod:TBLS1115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:TBLS1115&amp;diff=506617"/>
		<updated>2015-11-03T15:02:57Z</updated>

		<summary type="html">&lt;p&gt;Tb1713: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theophile Baissas Liquid Simulations Experiment&lt;br /&gt;
&lt;br /&gt;
TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by  x\left(t\right) = A\cos\left(\omega t + \phi\right) (the values of A, \omega, and \phi are worked out for you in the sheet).&lt;br /&gt;
&lt;br /&gt;
TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&lt;br /&gt;
&lt;br /&gt;
TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; x(t) = Acos(\omega t = \phi) &amp;lt;/math&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tb1713</name></author>
	</entry>
</feed>