<?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=Mbh213</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=Mbh213"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Mbh213"/>
	<updated>2026-04-13T20:48:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508975</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508975"/>
		<updated>2015-11-06T11:51:38Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: /* Dynamical properties and the diffusion coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Please see the thumbnail inserted for a large view of the energy profile of the 5 different timesteps.&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperature and two pressures. This gives ten phase points — five temperatures at each pressure. Submit these ten jobs to the HPC portal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\frac{3}{2}Nk_{b}T&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\frac{3}{2}Nk_{b}\tau&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\gamma^{2}\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\gamma^{2}\frac{3}{2}Nk_{b}T=\frac{3}{2}Nk_{b}\tau$ &lt;br /&gt;
&lt;br /&gt;
\gamma=\sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000.&lt;br /&gt;
How often will values of the temperature, etc., be sampled for the average? &lt;br /&gt;
How many measurements contribute to the average? &lt;br /&gt;
Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Nevery = use input values every this many timesteps; every 100 timesteps = variables are sampled.&lt;br /&gt;
*Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
*Nfreq = calculate averages every this many timesteps; every 100000 timesteps = average calculated from sampled data i.e. once for simulation.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot the density as a function of temperature for both of the pressures that you simulated.Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature with error bars.png|frameless|upright=2|Density vs Temperature graph with Ideal Gas Law plots and error bars]]]&lt;br /&gt;
&lt;br /&gt;
Clearly from the graph the simulated density is higher than that calculated from the ideal gas law (approximately 3-times larger).The error values calculated during the simulation and plotted as error bars show that this discrepancy cannot simply be a case of error in the calculations as the difference is too large.&lt;br /&gt;
&lt;br /&gt;
One plausible theory is that although a simple system only, the atoms in the box do not represent an ideal gas to a great extent. This would seem likely as there are pair interactions built into the simulation such that there are attractive (and repulsive) forces which could be more likely to bring the group of atoms together on the whole than if they were behaving as if without any intermolecular forces. This small amount of order provided by these forces could be enough to increase the density of the system above that of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
There seems to be little change to the density with increasing pressure and this could potentially support the idea of interactions establishing a stable level of order and increased density as the effects of pressure may be counteracted by a repulsive force between the atoms as they are squeezed into closer proximity.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot heat capacity as a function of temperature for both of your densities. &lt;br /&gt;
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:Heat Capacity vs Temperature.png|frameless|upright=2|(Volume-normalised) Heat capacity vs Temperature for densities: 0.2 &amp;amp; 0.8]]&lt;br /&gt;
&lt;br /&gt;
Trend for increasing temperature is in accordance with dependency of heat capacity on temperature at constant volume:&lt;br /&gt;
&amp;lt;math&amp;gt;C_{V}=(\frac{\delta U}{\delta T})_{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Nvt script part 1.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 1 of 2]]&lt;br /&gt;
[[File:Nvt script part 2.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 2 of 2]]&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:G(r).png|frameless|upright=2|g(r) for 4 phase points]]&lt;br /&gt;
[[File:Integral g(r).png|frameless|upright=2|Running integral of g(r)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Phase point chart.png|thumb|Phase point chart]]&lt;br /&gt;
&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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:Solid MSD 1M.png|thumb|Solid MSD 1M atoms]]&lt;br /&gt;
[[File:Liquid MSD 1M.png|thumb|Liquid MSD 1M atoms]]&lt;br /&gt;
[[File:Vapour MSD 1M.png|thumb|Vapour MSD 1M atoms]]&lt;br /&gt;
&lt;br /&gt;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
&lt;br /&gt;
(1/2d)* (∂〈r^2 (t)〉)/∂t = D&lt;br /&gt;
&lt;br /&gt;
D = diffusion coefficient (Units: distance2/unit time), d = number of dimensions, C = constant (representing in the solid, the mean squared displacement of an atom in a crystalline fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient is in this case unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At short times, the plot is not linear. This is because the the path a molecule takes will nearly be a straight line until it has a collision. Only when it starts the collision process will its path start to resemble brownian motion. &lt;br /&gt;
 &#039;&#039;&#039;TASK: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
v(t)=\frac{d(x(t))}{dt}=A\omega sin(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
Sin(x+y)=sin(x)cos(y)+sin(y)cos(x)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)cos(\omega\tau)+sin(\omega t+\phi)sin(\omega\tau)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{cos(\omega\tau)\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)+sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=cos(\omega\tau)+\frac{sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}=cos(\omega\tau)&lt;br /&gt;
&lt;br /&gt;
\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt=0&lt;br /&gt;
&lt;br /&gt;
\tau=0,C(\tau)=1&lt;br /&gt;
&lt;br /&gt;
\tau=\infty,C(\tau)=undefined&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This result is justified for all values of tau including infinity as the system is a harmonic oscillator and therefore the correlation of the variables with that system will fluctuate. &lt;br /&gt;
&lt;br /&gt;
Plot of the VACFs from the liquid and solid simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF liq sol HO.png|frameless|upright=2|VACF for simulated solid and liquids and for mathematically derived harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral S+L+V.png|thumb|Running integral - Solid, Liquid and Vapour]]&lt;br /&gt;
[[File:Running integral no vapour.png|thumb|Running integral - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
Repeat this procedure for the VACF data that you were given from the one million atom simulations. &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral 1M atoms.png|thumb|Running integral 1M atoms - Solid, Liquid, Vapour]]&lt;br /&gt;
[[File:Running integral 1M atoms no vapour.png|thumb|Running integral 1M atoms - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
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;
The largest source of error appears to be the use of the trapezium rule. Although generally a useful approximation it&#039;s nature lends it to either over or under estimate the function, giving a less accuract integral.&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508968</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508968"/>
		<updated>2015-11-06T11:47:20Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Please see the thumbnail inserted for a large view of the energy profile of the 5 different timesteps.&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperature and two pressures. This gives ten phase points — five temperatures at each pressure. Submit these ten jobs to the HPC portal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\frac{3}{2}Nk_{b}T&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\frac{3}{2}Nk_{b}\tau&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\gamma^{2}\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\gamma^{2}\frac{3}{2}Nk_{b}T=\frac{3}{2}Nk_{b}\tau$ &lt;br /&gt;
&lt;br /&gt;
\gamma=\sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000.&lt;br /&gt;
How often will values of the temperature, etc., be sampled for the average? &lt;br /&gt;
How many measurements contribute to the average? &lt;br /&gt;
Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Nevery = use input values every this many timesteps; every 100 timesteps = variables are sampled.&lt;br /&gt;
*Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
*Nfreq = calculate averages every this many timesteps; every 100000 timesteps = average calculated from sampled data i.e. once for simulation.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot the density as a function of temperature for both of the pressures that you simulated.Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature with error bars.png|frameless|upright=2|Density vs Temperature graph with Ideal Gas Law plots and error bars]]]&lt;br /&gt;
&lt;br /&gt;
Clearly from the graph the simulated density is higher than that calculated from the ideal gas law (approximately 3-times larger).The error values calculated during the simulation and plotted as error bars show that this discrepancy cannot simply be a case of error in the calculations as the difference is too large.&lt;br /&gt;
&lt;br /&gt;
One plausible theory is that although a simple system only, the atoms in the box do not represent an ideal gas to a great extent. This would seem likely as there are pair interactions built into the simulation such that there are attractive (and repulsive) forces which could be more likely to bring the group of atoms together on the whole than if they were behaving as if without any intermolecular forces. This small amount of order provided by these forces could be enough to increase the density of the system above that of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
There seems to be little change to the density with increasing pressure and this could potentially support the idea of interactions establishing a stable level of order and increased density as the effects of pressure may be counteracted by a repulsive force between the atoms as they are squeezed into closer proximity.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot heat capacity as a function of temperature for both of your densities. &lt;br /&gt;
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:Heat Capacity vs Temperature.png|frameless|upright=2|(Volume-normalised) Heat capacity vs Temperature for densities: 0.2 &amp;amp; 0.8]]&lt;br /&gt;
&lt;br /&gt;
Trend for increasing temperature is in accordance with dependency of heat capacity on temperature at constant volume:&lt;br /&gt;
&amp;lt;math&amp;gt;C_{V}=(\frac{\delta U}{\delta T})_{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Nvt script part 1.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 1 of 2]]&lt;br /&gt;
[[File:Nvt script part 2.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 2 of 2]]&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:G(r).png|frameless|upright=2|g(r) for 4 phase points]]&lt;br /&gt;
[[File:Integral g(r).png|frameless|upright=2|Running integral of g(r)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Phase point chart.png|thumb|Phase point chart]]&lt;br /&gt;
&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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:Solid MSD 1M.png|thumb|Solid MSD 1M atoms]]&lt;br /&gt;
[[File:Liquid MSD 1M.png|thumb|Liquid MSD 1M atoms]]&lt;br /&gt;
[[File:Vapour MSD 1M.png|thumb|Vapour MSD 1M atoms]]&lt;br /&gt;
&lt;br /&gt;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
&lt;br /&gt;
(1/2d)* (∂〈r^2 (t)〉)/∂t = D&lt;br /&gt;
&lt;br /&gt;
D = diffusion coefficient (Units: distance2/unit time), d = number of dimensions, C = constant (representing in the solid, the mean squared displacement of an atom in a crystalline fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient is in this case unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At short times, the plot is not linear. This is because the the path a molecule takes will nearly be a straight line until it has a collision. Only when it starts the collision process will its path start to resemble brownian motion. &lt;br /&gt;
 &#039;&#039;&#039;TASK: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
v(t)=\frac{d(x(t))}{dt}=A\omega sin(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
Sin(x+y)=sin(x)cos(y)+sin(y)cos(x)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)cos(\omega\tau)+sin(\omega t+\phi)sin(\omega\tau)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=\frac{cos(\omega\tau)\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)+sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=cos(\omega\tau)+\frac{sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}=cos(\omega\tau)&lt;br /&gt;
&lt;br /&gt;
\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt=0&lt;br /&gt;
&lt;br /&gt;
\tau=0,C(\tau)=1&lt;br /&gt;
&lt;br /&gt;
\tau=\infty,C(\tau)=undefined&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot of the VACFs from the liquid and solid simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF liq sol HO.png|frameless|upright=2|VACF for simulated solid and liquids and for mathematically derived harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral S+L+V.png|thumb|Running integral - Solid, Liquid and Vapour]]&lt;br /&gt;
[[File:Running integral no vapour.png|thumb|Running integral - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
Repeat this procedure for the VACF data that you were given from the one million atom simulations. &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral 1M atoms.png|thumb|Running integral 1M atoms - Solid, Liquid, Vapour]]&lt;br /&gt;
[[File:Running integral 1M atoms no vapour.png|thumb|Running integral 1M atoms - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
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;
The largest source of error appears to be the use of the trapezium rule. Although generally a useful approximation it&#039;s nature lends it to either over or under estimate the function, giving a less accuract integral.&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508948</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508948"/>
		<updated>2015-11-06T11:40:17Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Please see the thumbnail inserted for a large view of the energy profile of the 5 different timesteps.&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperature and two pressures. This gives ten phase points — five temperatures at each pressure. Submit these ten jobs to the HPC portal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\frac{3}{2}Nk_{b}T&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\frac{3}{2}Nk_{b}\tau&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\gamma^{2}\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\gamma^{2}\frac{3}{2}Nk_{b}T=\frac{3}{2}Nk_{b}\tau$ &lt;br /&gt;
&lt;br /&gt;
\gamma=\sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000.&lt;br /&gt;
How often will values of the temperature, etc., be sampled for the average? &lt;br /&gt;
How many measurements contribute to the average? &lt;br /&gt;
Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Nevery = use input values every this many timesteps; every 100 timesteps = variables are sampled.&lt;br /&gt;
*Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
*Nfreq = calculate averages every this many timesteps; every 100000 timesteps = average calculated from sampled data i.e. once for simulation.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot the density as a function of temperature for both of the pressures that you simulated.Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature with error bars.png|frameless|upright=2|Density vs Temperature graph with Ideal Gas Law plots and error bars]]]&lt;br /&gt;
&lt;br /&gt;
Clearly from the graph the simulated density is higher than that calculated from the ideal gas law (approximately 3-times larger).The error values calculated during the simulation and plotted as error bars show that this discrepancy cannot simply be a case of error in the calculations as the difference is too large.&lt;br /&gt;
&lt;br /&gt;
One plausible theory is that although a simple system only, the atoms in the box do not represent an ideal gas to a great extent. This would seem likely as there are pair interactions built into the simulation such that there are attractive (and repulsive) forces which could be more likely to bring the group of atoms together on the whole than if they were behaving as if without any intermolecular forces. This small amount of order provided by these forces could be enough to increase the density of the system above that of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
There seems to be little change to the density with increasing pressure and this could potentially support the idea of interactions establishing a stable level of order and increased density as the effects of pressure may be counteracted by a repulsive force between the atoms as they are squeezed into closer proximity.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot heat capacity as a function of temperature for both of your densities. &lt;br /&gt;
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:Heat Capacity vs Temperature.png|frameless|upright=2|(Volume-normalised) Heat capacity vs Temperature for densities: 0.2 &amp;amp; 0.8]]&lt;br /&gt;
&lt;br /&gt;
Trend for increasing temperature is in accordance with dependency of heat capacity on temperature at constant volume:&lt;br /&gt;
&amp;lt;math&amp;gt;C_{V}=(\frac{\delta U}{\delta T})_{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Nvt script part 1.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 1 of 2]]&lt;br /&gt;
[[File:Nvt script part 2.png|thumb|Adapted script for the calculation of the heat capacity of the systemPart 2 of 2]]&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:G(r).png|frameless|upright=2|g(r) for 4 phase points]]&lt;br /&gt;
[[File:Integral g(r).png|frameless|upright=2|Running integral of g(r)]]&lt;br /&gt;
&lt;br /&gt;
[[File:Phase point chart.png|thumb|Phase point chart]]&lt;br /&gt;
&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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:Solid MSD 1M.png|thumb|Solid MSD 1M atoms]]&lt;br /&gt;
[[File:Liquid MSD 1M.png|thumb|Liquid MSD 1M atoms]]&lt;br /&gt;
[[File:Vapour MSD 1M.png|thumb|Vapour MSD 1M atoms]]&lt;br /&gt;
&lt;br /&gt;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2d}\times \frac{∂〈r^2 (t)〉}{∂t} = D&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
D = diffusion coefficient (Units: distance2/unit time), d = number of dimensions, C = constant (representing in the solid, the mean squared displacement of an atom in a crystalline fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
&lt;br /&gt;
Diffusion coefficient is in this case unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At short times, the plot is not linear. This is because the the path a molecule takes will nearly be a straight line until it has a collision. Only when it starts the collision process will its path start to resemble brownian motion. &lt;br /&gt;
 &#039;&#039;&#039;TASK: Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
v(t)=\frac{d(x(t))}{dt}=A\omega sin(\omega t+\phi)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}v(t)v(t+\tau)dt}{\int_{-\infty}^{\infty}v^{2}(t)dt}=\frac{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}A^{2}\omega^{2}sin^{2}(\omega t+\phi)dt}=\frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)sin(\omega(t+\tau)+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
Sin(x+y)=sin(x)cos(y)+sin(y)cos(x)&lt;br /&gt;
&lt;br /&gt;
C(\tau)=\frac{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)cos(\omega\tau)+sin(\omega t+\phi)sin(\omega\tau)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}=\frac{cos(\omega\tau)\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)+sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}&lt;br /&gt;
&lt;br /&gt;
=cos(\omega\tau)+\frac{sin(\omega\tau)\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt}{\int_{-\infty}^{\infty}sin^{2}(\omega t+\phi)dt}=cos(\omega\tau)&lt;br /&gt;
&lt;br /&gt;
\int_{-\infty}^{\infty}sin(\omega t+\phi)cos(\omega t+\phi)dt=0&lt;br /&gt;
&lt;br /&gt;
\tau=0,C(\tau)=1&lt;br /&gt;
&lt;br /&gt;
\tau=\infty,C(\tau)=undefined&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot of the VACFs from the liquid and solid simulations.&lt;br /&gt;
&lt;br /&gt;
[[File:VACF liq sol HO.png|frameless|upright=2|VACF for simulated solid and liquids and for mathematically derived harmonic oscillator]]&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral S+L+V.png|thumb|Running integral - Solid, Liquid and Vapour]]&lt;br /&gt;
[[File:Running integral no vapour.png|thumb|Running integral - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
Repeat this procedure for the VACF data that you were given from the one million atom simulations. &lt;br /&gt;
&lt;br /&gt;
[[File:Running integral 1M atoms.png|thumb|Running integral 1M atoms - Solid, Liquid, Vapour]]&lt;br /&gt;
[[File:Running integral 1M atoms no vapour.png|thumb|Running integral 1M atoms - Solid and Liquid]]&lt;br /&gt;
&lt;br /&gt;
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;
The largest source of error appears to be the use of the trapezium rule. Although generally a useful approximation it&#039;s nature lends it to either over or under estimate the function, giving a less accuract integral.&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508871</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508871"/>
		<updated>2015-11-06T10:23:19Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Please see the thumbnail inserted for a large view of the energy profile of the 5 different timesteps.&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperature and two pressures. This gives ten phase points — five temperatures at each pressure. Submit these ten jobs to the HPC portal.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine&amp;lt;math&amp;gt;\gamma^{2}&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\frac{3}{2}Nk_{b}T&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\frac{3}{2}Nk_{b}\tau&lt;br /&gt;
&lt;br /&gt;
\frac{1}{2}\sum_{i}m_{i}(\gamma v_{i})^{2}=\gamma^{2}\frac{1}{2}\sum_{i}m_{i}v_{i}^{2}=\gamma^{2}\frac{3}{2}Nk_{b}T=\frac{3}{2}Nk_{b}\tau$ &lt;br /&gt;
&lt;br /&gt;
\gamma=\sqrt{\frac{\tau}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000.&lt;br /&gt;
How often will values of the temperature, etc., be sampled for the average? &lt;br /&gt;
How many measurements contribute to the average? &lt;br /&gt;
Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Nevery = use input values every this many timesteps; every 100 timesteps = variables are sampled.&lt;br /&gt;
*Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
*Nfreq = calculate averages every this many timesteps; every 100000 timesteps = average calculated from sampled data i.e. once for simulation.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot the density as a function of temperature for both of the pressures that you simulated.Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Density vs Temperature with error bars.png|frameless|upright=2|Density vs Temperature graph with Ideal Gas Law plots and error bars]]]&lt;br /&gt;
&lt;br /&gt;
Clearly from the graph the simulated density is higher than that calculated from the ideal gas law (approximately 3-times larger).The error values calculated during the simulation and plotted as error bars show that this discrepancy cannot simply be a case of error in the calculations as the difference is too large.&lt;br /&gt;
&lt;br /&gt;
One plausible theory is that although a simple system only, the atoms in the box do not represent an ideal gas to a great extent. This would seem likely as there are pair interactions built into the simulation such that there are attractive (and repulsive) forces which could be more likely to bring the group of atoms together on the whole than if they were behaving as if without any intermolecular forces. This small amount of order provided by these forces could be enough to increase the density of the system above that of an ideal gas.&lt;br /&gt;
&lt;br /&gt;
There seems to be little change to the density with increasing pressure and this could potentially support the idea of interactions establishing a stable level of order and increased density as the effects of pressure may be counteracted by a repulsive force between the atoms as they are squeezed into closer proximity.&lt;br /&gt;
&lt;br /&gt;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Plot heat capacity as a function of temperature for both of your densities. &lt;br /&gt;
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:Heat Capacity vs Temperature.png|frameless|upright=2|(Volume-normalised) Heat capacity vs Temperature for densities: 0.2 &amp;amp; 0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508796</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508796"/>
		<updated>2015-11-06T09:00:51Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Please see the thumbnail inserted for a large view of the energy profile of the 5 different timesteps.&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508790</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508790"/>
		<updated>2015-11-06T08:53:32Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying&amp;lt;math&amp;gt;x_{i}(0)&amp;lt;/math&amp;gt; and&amp;lt;math&amp;gt;v_{i}(0)&amp;lt;/math&amp;gt; , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:PTE Simulation 0.001.png|frameless|upright=2|0.001 timestep whole simulation]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Does the simulation reach equilibrium?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Equilibration of 0.001 PTE.png|frameless|upright=2|Initial equilibration of 0.001 timestep]]&lt;br /&gt;
&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 units time.&lt;br /&gt;
&lt;br /&gt;
[[File:Energy vs time for all timesteps.png|thumb|Total energy vs time for all timesteps]]&lt;br /&gt;
 &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. It can simulate 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
A bad choice would be a timestep as larger as 0.015 because it is not showing a constant energy which is a big indicator that it is simulating a real physical system poorly. Additionally, for simulations like these with a timestep of ~0.02 it has been observed that atoms are actually &#039;lost&#039; from the box because the snapshots of what is happening are too far apart and an atom has crossed a periodic boundary twice and has been declared &#039;lost&#039;. This is a big breakdown in the workings of the program but would be rectified by using a smaller timestep.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508778</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508778"/>
		<updated>2015-11-06T08:32:57Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;SPECIFY TIMESTEP&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable timestep equal 0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/${timestep})&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;variable n_steps equal floor(100/0.001)&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep ${timestep}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep0.001&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;RUN SIMULATION&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run ${n_steps}&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;run 100000 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;On the second line,why not just write: &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;timestep 0.001&lt;br /&gt;
 run 100000 ?&#039;&#039;&#039;&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508776</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508776"/>
		<updated>2015-11-06T08:24:53Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;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;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc lattice type.  &lt;br /&gt;
&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	[[File:Lattice type diagram.png|frameless|upright=2|Lattice types and features]]&lt;br /&gt;
&lt;br /&gt;
			&lt;br /&gt;
 &#039;&#039;&#039;TASK: How many atoms would be created by the create_atoms command if you had defined the fcc lattice instead?&#039;&#039;&#039;&lt;br /&gt;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
&lt;br /&gt;
*Gives the atom type (1) the mass of 1.0. There is only one atom type in these simulations.&lt;br /&gt;
*Instructs LAMMPS which method to use to calculate pairwise interactions between atoms. A cutoff distance for atom pairing is also defined, here as 3.0. &lt;br /&gt;
*Specifies the pairwise force field coefficients for the atom types.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&lt;br /&gt;
SPECIFY TIMESTEP&lt;br /&gt;
&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
timestep 0.001&lt;br /&gt;
&lt;br /&gt;
RUN SIMULATION&lt;br /&gt;
&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
On the second line,why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated,including in equations, through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508765</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508765"/>
		<updated>2015-11-06T07:54:40Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
Not only does this keep the number of atoms in the box constant but it enables us to build a better model of a macroscopic system. This is due to all the atoms being surrounded by a simulated environment &#039;infinitely&#039; in all directions and they aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions (due to the large dependency of the Lennard-Jones potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to eachother and this behaviour wouldn’t accurately simulate the desired state.&lt;br /&gt;
Alternatively of course, the other side of this is that atom pairs that were generated too close to each other, &amp;lt;math&amp;gt;r &amp;lt; r_{eq}&amp;lt;/math&amp;gt;, could have a very high energy intial state in the simulation and could lead to eratic velocities and more collisions.&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.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}{(number.of.lattices.on.side.of.cube\times lattice.side.length)^{3}}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.point.density=  \frac{(1\times (10)^{3})}{((10\times 1.07722)^{3}} =0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice.side.length =  \frac{\sqrt[3]{\frac{(lattice.point.density)}{(number.of.lattice.points.per.lattice\times total.number.of.lattices)}^{-1}}}{(number.of.lattices.on.a.side.of.cube)}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;lattice side length =  \frac{\sqrt[3]{\frac{(1.2)}{(4\times(10)^{3})}^{-1}}}{(10)}=1.49380&amp;lt;/math&amp;gt; , &lt;br /&gt;
&lt;br /&gt;
Confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
	&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508739</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508739"/>
		<updated>2015-11-06T07:16:25Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=\frac{T^{*}\epsilon}{k_{b}}=1.5\times120=180K&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1 mL of water under standard conditions. Estimate the volume of 1 mole of water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Density of pure water at 0°C &amp;lt;math&amp;gt;(STP) = 0.999 g/mL&amp;lt;/math&amp;gt;, at 25°C &amp;lt;math&amp;gt;(SATP) = 0.997 g/mL&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
STP:&lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.999/ 18.015 = 0.05545 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;0.05545\times6.022\times10^{23} = 3.3394\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SATP: &lt;br /&gt;
&amp;lt;math&amp;gt;Mr = 18.015 g/mol &amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore for &amp;lt;math&amp;gt;0.997/ 18.015 = 0.05534 moles&amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;0.05534 x 6.022\times10^{23} = 3.3327\times10^{22}&amp;lt;/math&amp;gt; molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;10000/6.022\times10^{23} = 1.6606\times10^{-21} moles&amp;lt;/math&amp;gt;  &lt;br /&gt;
&amp;lt;math&amp;gt;\times18.015 g/mol = 2.9915\times10^{-20} g &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.999 = 2.9945\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;/ 0.997 = 3.0005\times10^{-20} mL &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Without periodic boundary conditions, a real atom  in this scenario would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&lt;br /&gt;
&lt;br /&gt;
[[File:2D periodic boundary.png|frameless|upright=2|Periodic boundary diagram]]&lt;br /&gt;
&lt;br /&gt;
This enables us to build a better model of a macroscopic system as it means that all the atoms of interest are surrounded by a simulated environment &#039;infinitely&#039; in all directions and aren&#039;t faced with a sharp drop in potential or a vacuum on the exterior of the box.&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508729</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508729"/>
		<updated>2015-11-06T06:40:20Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:L-J diagram graph.png|frameless|upright=2|Typical Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;F(r_{0})=\frac{d\phi(r_{0})}{dr_{0}}=\frac{d(4\epsilon(\sigma^{12}r_{0}^{-12}-\sigma^{6}r_{0}^{-6})}{dr_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: From: &amp;lt;math&amp;gt;r_{0}=\sigma&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;F(r_{0})=4\epsilon(\frac{6}{r_{0}}-\frac{12}{r_{0}})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::::: &amp;lt;math&amp;gt;F(r_{0})=\frac{-24\epsilon}{r_{0}}&amp;lt;/math&amp;gt;&lt;br /&gt;
This is a net repulsive force as &amp;lt;math&amp;gt; r_{0}&amp;lt; r_{eq}&amp;lt;/math&amp;gt; which is a higher energy bond distance.&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{d\phi(r_{eq})}{dr_{eq}}=\frac{d(4\epsilon\left(\sigma^{12}r_{eq}^{-12}-\sigma^{6}r_{eq}^{-6}\right)}{dr_{eq}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(6\sigma^{6}r_{eq}^{-7}-12\sigma^{12}r_{eq}^{-13})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::: Therefore: &amp;lt;math&amp;gt;6\sigma^{6}r_{eq}^{-7}=12\sigma^{12}r_{eq}^{-13}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}\thickapprox1.122\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::Using the result that: &amp;lt;math&amp;gt;r_{eq}=\sigma\sqrt[6]{2}&amp;lt;/math&amp;gt;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r_{eq})=4\epsilon(\frac{\sigma^{12}}{r_{eq}^{12}}-\frac{\sigma^{6}}{r_{eq}^{6}})=4\epsilon(\frac{\sigma^{12}}{\left(\sigma\sqrt[6]{2}\right)^{12}}-\frac{\sigma^{6}}{\left(\sigma\sqrt[6]{2}\right)^{6}})=4\epsilon(\frac{\sigma^{12}}{\sigma^{12}2^{2}}-\frac{\sigma^{6}}{\sigma^{6}2})&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;=4\epsilon(\frac{1}{4}-\frac{1}{2})=-\epsilon&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
::::: &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr=[4\epsilon\sigma(\frac{r^{-5}}{5}-\frac{r^{-11}}{11})]_{a\sigma}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Integral of L-J.png|frameless|upright=2|Integral of Lennard-Jones potential]]&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^{*}\sigma=3.2\times0.34nm=1.088nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
From the derivative of &amp;lt;math&amp;gt;\phi(r)&amp;lt;/math&amp;gt; we know that for &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, the well depth is = &amp;lt;math&amp;gt;-\epsilon&amp;lt;/math&amp;gt; &lt;br /&gt;
Therefore for the magnitude of the argon well depth, find ε.&lt;br /&gt;
From the argon Lennard-Jones parameters &amp;lt;math&amp;gt;\epsilon = k_{b}\times 120 = 8.314\times10^{-3}\times120 = 9.98\times10^{-1}kJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508699</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508699"/>
		<updated>2015-11-06T04:39:35Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508697</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508697"/>
		<updated>2015-11-06T04:37:24Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                     &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                     &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508696</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508696"/>
		<updated>2015-11-06T04:36:07Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\phi(r)=4\epsilon\left(\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}\right)=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::Therefore:                 &amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}-\frac{\sigma^{6}}{r_{0}^{6}}=0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_{0}^{12}}=\frac{\sigma^{6}}{r_{0}^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:::::&amp;lt;math&amp;gt;\frac{\sigma^{12}}{\sigma^{6}}=\frac{r_{0}^{12}}{r_{0}^{6}}=\sigma^{6}=r_{0}^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::It follows that:                 &amp;lt;math&amp;gt;\sigma=r_{0}&amp;lt;/math&amp;gt;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508686</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508686"/>
		<updated>2015-11-06T04:26:38Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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. &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;What is the force at this separation? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;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(r_{eq})&amp;lt;/math&amp;gt;). &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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? &#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;What is the well depth in kJ/mol? &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508676</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508676"/>
		<updated>2015-11-06T04:02:24Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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(r_{eq})&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma=0.34nm,\epsilon/k_{b}=120K&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 kJ/mol? What is the reduced temperature &amp;lt;math&amp;gt;T^{*}=1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508672</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508672"/>
		<updated>2015-11-06T03:46:40Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,&amp;lt;math&amp;gt; \phi(r)=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(r_{eq})&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{a\sigma}^{\infty}\phi(r)dr &amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;a=2.0,2.5,3.0 &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;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508668</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508668"/>
		<updated>2015-11-06T03:31:33Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Classical harmonic oscillator / velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508666</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508666"/>
		<updated>2015-11-06T03:27:31Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. In accordance with the Law of the Conservation of Energy, for an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from this physical law is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508665</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508665"/>
		<updated>2015-11-06T03:24:31Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
  &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
 &#039;&#039;&#039;Why is it important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It is important to monitor the total internal energy change throughout a simulation in order to assess how well the model meets the condition that energy must be conserved. For an isolated simulated system, such as a box of simple particles, the total internal energy should remain constant to reflect that seen by experiment. &lt;br /&gt;
&lt;br /&gt;
Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to make the model more realistic. Such deviation from the law of conservation of energy is a reflection upon the quality of the approximations made to simulate the system and thus measurements of this deviation can provide numerical information about the accuracy of the simulation.&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508661</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508661"/>
		<updated>2015-11-06T03:14:37Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
&lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &#039;&#039;&#039;TASK: Experiment with different values of the timestep to discover the point at which the total energy change is = 1%. &lt;br /&gt;
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;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!timestep value&lt;br /&gt;
!0.100&lt;br /&gt;
!0.125&lt;br /&gt;
!0.150&lt;br /&gt;
!0.175&lt;br /&gt;
!0.200&lt;br /&gt;
!0.230&lt;br /&gt;
|-&lt;br /&gt;
|% change &lt;br /&gt;
|0.25&lt;br /&gt;
|0.39&lt;br /&gt;
|0.56&lt;br /&gt;
|0.77&lt;br /&gt;
|1.00&lt;br /&gt;
|1.27&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508659</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508659"/>
		<updated>2015-11-06T03:03:12Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;Graphical representation of these results are supplied by the thumbnails on the left.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
:::::::::::::::::::::::::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508657</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508657"/>
		<updated>2015-11-06T03:02:14Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====== Graphical representation of these results are supplied by the thumbnails on the left. ======&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
:::::::::::::::::::::::::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
 &#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&lt;br /&gt;
 &#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
 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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
 &#039;&#039;&#039;TASK: Look at the lines below. What do you think the purpose of these is?&#039;&#039;&#039;&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;
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, Why not just write: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
 &#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &#039;&#039;&#039;&lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &#039;&#039;&#039;&lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
 &#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
 &#039;&#039;&#039;TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  . 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;
== Calculating heat capacities using statistical physics ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
== Structural properties and the radial distribution function ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &#039;&#039;&#039;&lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Dynamical properties and the diffusion coefficient ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
 &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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!): Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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;
 &#039;&#039;&#039; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;TASK: 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  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>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508656</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508656"/>
		<updated>2015-11-06T02:55:08Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====== Graphical representation of these results are supplied by the thumbnails on the left. ======&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Harmonic oscillator/velocity-Verlet error maxima as a function of time: &lt;br /&gt;
[[File:Error maxima graph.png|frameless|upright=2|Error maxima vs time elapsed]]&lt;br /&gt;
:::::::::::::::::::::::::::{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
[[File:Pcchange graph.png|frameless|upright=2|Percentage change in energy vs timestep value]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508652</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508652"/>
		<updated>2015-11-06T02:42:48Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: /* Graphical representation of these results are supplied by the thumbnails on the left. */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====== Graphical representation of these results are supplied by the thumbnails on the left. ======&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and wanes through clear maxima with an overall trend of increasing as the simulation progresses. &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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508651</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508651"/>
		<updated>2015-11-06T02:40:42Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method by modelling with a partially prepared data set. Basic graphical analysis of the trends and error have been conducted and presented below.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====== Graphical representation of these results are supplied by the thumbnails on the left. ======&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and waines with an overall trend of increasing as the simulation progresses. Further trends involving this error are discussed below.&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508647</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508647"/>
		<updated>2015-11-06T02:37:02Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====== Graphical representation of these results are supplied by the thumbnails on the left. ======&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and waines with an overall trend of increasing as the simulation progresses. Further trends involving this error are discussed below.&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508646</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508646"/>
		<updated>2015-11-06T02:34:34Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:&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;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position x(t): &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; Error=|x_{HO}(t)-x_{VV}(t)|&amp;lt;/math&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &lt;br /&gt;
:&amp;lt;math&amp;gt; Energy=\frac{1}{2}(kx^{2}+mv^{2}) &amp;lt;/math&amp;gt; &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution are supplied by the thumbnails on the left.&lt;br /&gt;
&lt;br /&gt;
In summary, there is only a very small deviation between the two methods according to the x(t) vs time graph. Additionally as can be seen, the total energy of the approximate velocity-Verlet system fluctuates about the constant average of the exact solution. &lt;br /&gt;
&lt;br /&gt;
This is consistent with the conservation of energy that we expect for a real situation in which the energy is soley transferred between potential and kinetic forms.&lt;br /&gt;
&lt;br /&gt;
Finally, the absolute error between the two models waxes and waines with an overall trend of increasing as the simulation progresses. Further trends involving this error are discussed below.&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508634</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508634"/>
		<updated>2015-11-06T01:58:54Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position:  &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508633</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508633"/>
		<updated>2015-11-06T01:58:21Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position:  &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|left|Energy vs time elapsed]][[File:Error graph.png|thumb|left|Error vs time elapsed]]&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508632</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508632"/>
		<updated>2015-11-06T01:55:21Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position:  &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
[[File:X(t) graph.png|thumb|left|Position vs time elapsed]][[File:Energy graph.png|thumb|center|Energy vs time elapsed]][[File:Error graph.png|thumb|right|Error vs time elapsed]]&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508623</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508623"/>
		<updated>2015-11-06T01:44:15Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
[[File:X(t) graph.png|frameless|upright=2|Position vs time elapsed]]&lt;br /&gt;
[[File:Energy graph.png|frameless|upright=2|Energy vs time elapsed]]&lt;br /&gt;
[[File:Error graph.png|frameless|upright=2|Error vs time elapsed]]&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508619</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508619"/>
		<updated>2015-11-06T01:21:56Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|Energy graph]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508617</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508617"/>
		<updated>2015-11-06T01:19:11Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508614</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508614"/>
		<updated>2015-11-06T01:17:15Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508613</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508613"/>
		<updated>2015-11-06T01:15:15Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: /* Classical Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;https://commons.wikimedia.org/wiki/File:Energy_graph.png&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508612</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508612"/>
		<updated>2015-11-06T01:13:32Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508611</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508611"/>
		<updated>2015-11-06T01:13:05Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Neptune Full.jpg|Neptune Full]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508610</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508610"/>
		<updated>2015-11-06T01:10:33Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.jpg|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508609</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508609"/>
		<updated>2015-11-06T01:08:52Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508608</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508608"/>
		<updated>2015-11-06T01:07:49Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[File:Image name.jpg|thumb|right|Caption for the image]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:X(t) graph.png|thumb|Position vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Energy graph.png|thumb|Energy vs time elapsed]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:Error graph.png|thumb|Error vs time elapsed]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508607</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508607"/>
		<updated>2015-11-06T01:02:54Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[[File:X(t) graph.png|thumb|Position vs time elapsed]] [[File:Energy graph.png|thumb|Energy vs time elapsed]] [[File:Error graph.png|thumb|Error vs time elapsed]]&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508604</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508604"/>
		<updated>2015-11-06T01:00:36Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508600</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508600"/>
		<updated>2015-11-06T00:59:50Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
[[File:X(t) graph.png|thumb|Position vs time elapsed]] [[File:Energy graph.png|thumb|Energy vs time elapsed]] [[File:Error graph.png|thumb|Error vs time elapsed]]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508597</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508597"/>
		<updated>2015-11-06T00:58:57Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt; &lt;br /&gt;
::&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&amp;lt;gallery&amp;gt;&lt;br /&gt;
[[File:X(t) graph.png|thumb|Position vs time elapsed]] [[File:Energy graph.png|thumb|Energy vs time elapsed]] [[File:Error graph.png|thumb|Error vs time elapsed]]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508594</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508594"/>
		<updated>2015-11-06T00:58:04Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
 &#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt;&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by the sum of the potential and kinetic components: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&amp;lt;gallery&amp;gt;&lt;br /&gt;
[[File:X(t) graph.png|thumb|Position vs time elapsed]], [[File:Energy graph.png|thumb|Energy vs time elapsed]], [[File:Error graph.png|thumb|Error vs time elapsed]]&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&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. &#039;&#039;&#039;&lt;br /&gt;
Plot of the error maxima as a function of time: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.00&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508534</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508534"/>
		<updated>2015-11-05T23:53:03Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: /* Classical Harmonic Oscillator */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided.&#039;&#039;&#039;&lt;br /&gt;
:A comparison of the classical harmonic oscillator with the velocity-Verlet method.&lt;br /&gt;
::&#039;ANALYTICAL&#039; values for the position of a harmonic oscillator given by:   &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt;&#039;ERROR&#039; values are given by the modulus of the difference between the harmonic oscillator and velocity-Verlet results for position: &lt;br /&gt;
::&#039;ENERGY&#039; values represent the total energy of the oscillator as calculated in the velocity-Verlet system by: &#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Plot of the maxima as a function of time &#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.01&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508512</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508512"/>
		<updated>2015-11-05T23:20:35Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided according to the classical harmonic oscillator solution: &lt;br /&gt;
::&amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Plot of the maxima as a function of time &#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.01&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508509</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508509"/>
		<updated>2015-11-05T23:19:05Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&#039;&#039;&#039;A third year computational chemistry exercise by Michael Howlett.&#039;&#039;&#039;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided according to the classical harmonic oscillator solution: &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Plot of the maxima as a function of time &#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.01&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508172</id>
		<title>Rep:Mod:MH2015LS</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:MH2015LS&amp;diff=508172"/>
		<updated>2015-11-05T18:20:56Z</updated>

		<summary type="html">&lt;p&gt;Mbh213: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= &#039;&#039;&#039;Molecular Dynamics - Liquid Simulation&#039;&#039;&#039; =&lt;br /&gt;
&lt;br /&gt;
=== A third year computational exercise by Michael Howlett. ===&lt;br /&gt;
&lt;br /&gt;
=== Abstract ===&lt;br /&gt;
wordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswordswordswordswordswords wordswordswordswordswordswordswordswords wordswordswordswords&lt;br /&gt;
&lt;br /&gt;
== Classical Harmonic Oscillator ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot; and &amp;quot;ENERGY&amp;quot; in the excel file provided according to the classical harmonic oscillator solution: &amp;lt;math&amp;gt; x(t)=Acos(\omega t+\phi) &amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Graphical comparison of these results to the Velocity-Verlet solution gives:&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#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. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Plot of the maxima as a function of time &#039;&#039;&#039;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!time&lt;br /&gt;
!2.00&lt;br /&gt;
!4.90&lt;br /&gt;
!8.00&lt;br /&gt;
!11.10&lt;br /&gt;
!14.20&lt;br /&gt;
|-&lt;br /&gt;
|Error value /x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|0.758&lt;br /&gt;
|2.01&lt;br /&gt;
|3.30&lt;br /&gt;
|4.60&lt;br /&gt;
|5.91&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The limiting timestep to prevent &amp;gt;1% change in the total energy during the simulation is = 0.200 as shown by the inserted graph.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039; 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;
Conservation of energy: &lt;br /&gt;
For an isolated simulated system, the total internal energy should remain constant to reflect that seen in experiment? Any fluctuations seen are likely due to the approximations made in the computation and should be minimised in order to increase the accuracy of the simulation. ?&lt;br /&gt;
&lt;br /&gt;
== Lennard-Jones Potential ==&lt;br /&gt;
&#039;&#039;&#039;TASK: For a single Lennard-Jones interaction,  , find the separation,  , at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation,  , and work out the well depth ( ). Evaluate the integrals  ,  , and  when  .&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are  . If the LJ cutoff is  , what is it in real units? What is the well depth in  ? What is the reduced temperature  in real units?&#039;&#039;&#039;&lt;br /&gt;
r = r*σ = 3.2 * 0.34 nm = 1.088 nm = 1.088 x 10^-9 m&lt;br /&gt;
From the derivative of V(r) we know that for rmin, the well depth is = ε &lt;br /&gt;
Therefore for the argon well depth, find ε. From the argon L-J parameters ε = kb * 120 = 8.314E-3 *120 = 9.98E-1 kJ/mol&lt;br /&gt;
T = Tε/Kb = 1.5*120 = 180 K &lt;br /&gt;
We denote these reduced quantities by a star, and they take the following conversion factors: &lt;br /&gt;
	distance  &lt;br /&gt;
	energy  &lt;br /&gt;
	temperature&lt;br /&gt;
&lt;br /&gt;
== Simulation theory - additional exercises and questions ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1mL of water under standard conditions. Estimate the volume of  water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
Density of pure water at 0°C (STP) = 0.999 g/mL, at 25°C (SATP) = 0.997 g/mL&lt;br /&gt;
STP:&lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.999/ 18.015 = 0.05545 moles&lt;br /&gt;
0.05545 x 6.022 x 10^23 = 3.3394 x 10^22 molecules of H2O.&lt;br /&gt;
SATP: &lt;br /&gt;
Mr = 18.015 g/mol &lt;br /&gt;
Therefore for 0.997/ 18.015 = 0.05534 moles&lt;br /&gt;
0.05534 x 6.022 x 10^23 = 3.3327 x 10^22 molecules of H2O.&lt;br /&gt;
&lt;br /&gt;
10000/6.022 x 10^23 = 1.6606 x 10^-21 moles &lt;br /&gt;
x 18.015 g/mol = 2.9915 x 10^-20 g &lt;br /&gt;
/ 0.999 = 2.9945 x10^-20 mL&lt;br /&gt;
/ 0.997 = 3.0005 x10^-20 mL  &lt;br /&gt;
Absolutely tiny fraction of 1 mL, i.e. an impossibly small volume for real world use.&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position  in a cubic simulation box which runs from  to  . In a single timestep, it moves along the vector  . At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
Without periodic boundary conditions, a real atom would end up at position vector [1.2, 1.1, 0.7] with respect to the origin in the starting box. &lt;br /&gt;
However with the periodic boundary conditions applied in a simulation, the particle will &#039;reappear&#039; at the opposite side of the box as it crosses the boundary into the adjacent simulated box. Therefore, traveling [0.7, 0.6, 0.2] from the middle of the original box, [0.5,0.5,0.5], the atom will end the timestep in position [0.2, 0.1, 0.7].&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;
Were atoms to be too close to each other in their initial state then there is the possibility that this could lead to strong intermolecular interactions between these (due to the large dependency of the L-J potential on distance r) and atom pairs could be formed at the equilibrium bond length. Taking this idea further, clusters of atoms could become strongly attracted to oneanother and this setup wouldn’t accurately simulate liquid behavior.&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  . 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;
lattice point density=  (number of lattice points per lattice ×total number of lattices)/〖(number of lattices on side of cube ×lattice side length)〗^3 &lt;br /&gt;
lattice point density=  (1 ×〖10〗^3)/〖(10 ×1.07722)〗^3 =0.8&lt;br /&gt;
10 x 10 x 10 cubic lattices of side length 1.07722 each. Therefore the simulation comprises of a volume of 10.77223 = 1250.009 volume units. &lt;br /&gt;
For the 1.2 fcc density case:&lt;br /&gt;
lattice side length =  ∛(((lattice point density)/(number of lattice points per lattice ×total number of lattices))^(-1) )/(number of lattices on a side of cube)&lt;br /&gt;
&lt;br /&gt;
lattice side length =  ∛((1.2/(4 ×〖10〗^3 ))^(-1) )/10=1.49380 , confirmed by simulation of fcc.&lt;br /&gt;
As shown in diagram, with an atom at each lattice point, the inter-atom spacing is half that of the lattice unit cell side length. &lt;br /&gt;
Lattice spacing = 1.07722 					Lattice spacing = 1.49380 / 2 = 0.7469&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;
For a 10 x 10 x 10 cube of fcc lattices. Atom at every lattice point and 4 lattice points per fcc lattice.&lt;br /&gt;
Therefore for the pre-set simulation box of 10 x 10 x 10 for a 0.8 lattice point density with a fcc system the number of atoms produced = 4000.&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;
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;
Specify the pairwise force field coefficients for one or more pairs of atom types.&lt;br /&gt;
&lt;br /&gt;
Simple cubic (left) and face-centred cubic (right) lattice types. [image]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below. &#039;&#039;&#039;&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;
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: &lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
Ask the demonstrator if you need help.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
Because it enables you to change a single line that specifies the value of the variable ‘timestep’ and the change will be propagated through the rest of the script without extra work.&lt;br /&gt;
&lt;br /&gt;
== Equilibrium simulations ==&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying  and  , which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
Velocity-Verlet Method&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). &lt;br /&gt;
Does the simulation reach equilibrium?&#039;&#039;&#039; &lt;br /&gt;
The system does reach an equilibrium in which the temperature and pressure fluctuate about an average value. The total energy is, as expected, constant throughout. As shown by the plot the system reaches this average equilibrium state within 0.2 - 0.4 seconds.&lt;br /&gt;
&#039;&#039;&#039;How long does this take? &lt;br /&gt;
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). &lt;br /&gt;
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. &lt;br /&gt;
Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
0.0025 is a good one to choose. 2.5x the actual time covered vs the 0.001 but with a very small change in the average energy value according to the graphs.&lt;br /&gt;
&lt;br /&gt;
Running simulations under specific conditions&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Choose 5 temperatures (above the critical temperature  ), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen  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;TASK: We need to choose  so that the temperature is correct  if we multiply every velocity  . We can write two equations:&#039;&#039;&#039; &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Solve these to determine . &lt;br /&gt;
γ^2  1/(2 ) ∑_i▒〖m_i v_i^2= 3/2〗 Nk_B T&lt;br /&gt;
Given&#039;&#039;&#039;    &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;γ^2  3/2 Nk_B T=  3/2 Nk_B T&lt;br /&gt;
Therefore &lt;br /&gt;
γ= √(T/T)&lt;br /&gt;
TASK: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&lt;br /&gt;
	Nevery = use input values every this many timesteps&lt;br /&gt;
	Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
	Nfreq = calculate averages every this many timesteps&lt;br /&gt;
TASK: 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  . 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;
Calculating heat capacities using statistical physics&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature  phase space, rather than pressure-temperature phase space. The two densities required at  and  , and the temperature range is  . Plot  as a function of temperature, where  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;
Structural properties and the radial distribution function&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate  and  . Plot the RDFs for the three systems on the same axes, and attach a copy to your report. &lt;br /&gt;
Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. &lt;br /&gt;
In the solid case, illustrate which lattice sites the first three peaks correspond to. &lt;br /&gt;
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;
Dynamical properties and the diffusion coefficient&lt;br /&gt;
&lt;br /&gt;
T&#039;&#039;&#039;ASK: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.&lt;br /&gt;
TASK: 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  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;
〈r^2 (t)〉=2dDt+C &lt;br /&gt;
1/2d  ∂〈r^2 (t)〉/∂t=D&lt;br /&gt;
D = diffusion coefficient Units: distance2/unit time, d = number of dimensions, C = constant (representing in the solid the mean squared displacement of a simulated fcc lattice at equilibrium)&lt;br /&gt;
D = gradient /2d&lt;br /&gt;
Own simulations:&lt;br /&gt;
Ds = 3.82x10-8/ (2 X 3) = 6.367 x10-9 &lt;br /&gt;
Dl = 5.09x10-1/ (2 X 3) = 8.483 x10-2 &lt;br /&gt;
Dv = 9.41/ (2 X 3) = 1.568&lt;br /&gt;
Million atoms:&lt;br /&gt;
Ds = 3.18x10-8/ (2 X 3) = 5.300 x10-9 &lt;br /&gt;
Dl = 5.24x10-1/ (2 X 3) = 8.733 x10-2 &lt;br /&gt;
Dv = 1.88x101/ (2 X 3) = 3.133&lt;br /&gt;
Unitless but not dimensionless (m^2/s) i.e length^2/time&lt;br /&gt;
&lt;br /&gt;
&amp;quot;uncorrelated”&lt;br /&gt;
http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html&lt;br /&gt;
Write in own words “At very short times however, the plot is not linear. This is because the the path a molecule takes will be an approximate straight line until it collides with its neighbour. Only when it starts the collision process will its path start to resemble a random walk. Until it makes that first collision, we may say it moves with approximately constant velocity, which means the distance it travels is proportional to time, and its MSD is therefore proportional to the time squared. Thus at very short time, the MSD resembles a parabola. This is of course a simplification - the collision between molecules is not like the collision between two pebbles, it is not instantaneous in space or time, but is `spread out&#039; a little in both. This means that the behaviour of the MSD at short time is sometimes more complicated than this MSD plot shows.” Democritus&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;TASK: 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;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot  with  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. &lt;br /&gt;
&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: 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  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;
&#039;&#039;&#039;Bold text&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Mbh213</name></author>
	</entry>
</feed>