<?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=Jkt115</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=Jkt115"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Jkt115"/>
	<updated>2026-04-08T05:59:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634054</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634054"/>
		<updated>2017-10-25T10:47:01Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: /* Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Simulations were ran on the LAMMPS application for LJ solids, liquids and vapours. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulation is &amp;quot;widely used to study a huge variety of chemical phenomena, from the behaviour of exotic materials under extreme conditions to protein folding and the properties of biological systems such as lipid membranes&amp;quot;.[1] A recent discovery show that water diffusion between graphene oxide layers is slow because of the strong hydrogen bonding interactions. This causes most of the water molecules are bound to OH groups even at the highest hydration level. These graphene oxide layers will potentially revolutionize water filtration and desalination if selective transport of molecules can be controlled.[2] This experiment is going to investigate how number density and heat capacity vary with temperature. The structure of solid, liquid and vapour phase will be determined using RDF and the diffusion coefficient will be calculated using MSD and VACF.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
All the simulations were ran through the LAMMPS application via the HPC portal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NpT ensemble. The densities used were 2.8 and 1.8. The temperatures used were 1.8, 2.0, 2.2, 2.4 and 2.6. A timestep of 0.0025 was used because it gave accurate results without taking a long time to simulate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NVT ensemble. The densities used were 0.2 and 0.8. The temperatures used were 2.0, 2.2, 2.4, 2.6 and 2.8. The input file could be found in TASKS. A timestep of 0.0025 was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
It is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
&lt;br /&gt;
Integration of the VACF using the trapezium rule (&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(&amp;lt;/math&amp;gt;1st height&amp;lt;math&amp;gt;) + 2(&amp;lt;/math&amp;gt;sum of other heights&amp;lt;math&amp;gt;)_{n-1} + (&amp;lt;/math&amp;gt;last height&amp;lt;math&amp;gt;)_n]&amp;lt;/math&amp;gt;) can be used to calculate the diffusion coefficient using: &amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
The most useful timestep was found to be 0.0025 because it gives accurate results while not taking a long time to simulate. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. The integral of RDF in solid phase shows that there are 12 atoms that has a spacing of 1.025, 18 atoms with spacing of 1.475 and 42 atoms with a spacing of 1.825. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid. For future experiments, more than one atom type could be used to see the effect that it has on the RDF. Improvements could be made by using smaller trapeziums when integrating the VACF.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
[1] https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&lt;br /&gt;
&lt;br /&gt;
[2] https://www.nature.com/articles/srep29484?WT.feed_name=subjects_physical-sciences&lt;br /&gt;
&lt;br /&gt;
[3] http://lammps.sandia.gov&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Velocity Autocorrelation Function==&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634053</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634053"/>
		<updated>2017-10-25T10:46:23Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Simulations were ran on the LAMMPS application for LJ solids, liquids and vapours. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulation is &amp;quot;widely used to study a huge variety of chemical phenomena, from the behaviour of exotic materials under extreme conditions to protein folding and the properties of biological systems such as lipid membranes&amp;quot;.[1] A recent discovery show that water diffusion between graphene oxide layers is slow because of the strong hydrogen bonding interactions. This causes most of the water molecules are bound to OH groups even at the highest hydration level. These graphene oxide layers will potentially revolutionize water filtration and desalination if selective transport of molecules can be controlled.[2] This experiment is going to investigate how number density and heat capacity vary with temperature. The structure of solid, liquid and vapour phase will be determined using RDF and the diffusion coefficient will be calculated using MSD and VACF.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
All the simulations were ran through the LAMMPS application via the HPC portal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NpT ensemble. The densities used were 2.8 and 1.8. The temperatures used were 1.8, 2.0, 2.2, 2.4 and 2.6. A timestep of 0.0025 was used because it gave accurate results without taking a long time to simulate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NVT ensemble. The densities used were 0.2 and 0.8. The temperatures used were 2.0, 2.2, 2.4, 2.6 and 2.8. The input file could be found in TASKS. A timestep of 0.0025 was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
It is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
&lt;br /&gt;
Integration of the VACF using the trapezium rule (&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(&amp;lt;/math&amp;gt;1st height&amp;lt;math&amp;gt;) + 2(&amp;lt;/math&amp;gt;sum of other heights&amp;lt;math&amp;gt;)_{n-1} + (&amp;lt;/math&amp;gt;last height&amp;lt;math&amp;gt;)_n]&amp;lt;/math&amp;gt;) can be used to calculate the diffusion coefficient using: &amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
The most useful timestep was found to be 0.0025 because it gives accurate results while not taking a long time to simulate. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. The integral of RDF in solid phase shows that there are 12 atoms that has a spacing of 1.025, 18 atoms with spacing of 1.475 and 42 atoms with a spacing of 1.825. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid. For future experiments, more than one atom type could be used to see the effect that it has on the RDF. Improvements could be made by using smaller trapeziums when integrating the VACF.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
[1] https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&lt;br /&gt;
[2]  http://lammps.sandia.gov&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Velocity Autocorrelation Function==&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634021</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634021"/>
		<updated>2017-10-25T10:29:09Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Simulations were ran on the LAMMPS application for LJ solids, liquids and vapours. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulation is &amp;quot;widely used to study a huge variety of chemical phenomena, from the behaviour of exotic materials under extreme conditions to protein folding and the properties of biological systems such as lipid membranes&amp;quot;.[1] This experiment is going to investigate how number density and heat capacity vary with temperature. The structure of solid, liquid and vapour phase will be determined using RDF and the diffusion coefficient will be calculated using MSD and VACF.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
All the simulations were ran through the LAMMPS application via the HPC portal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NpT ensemble. The densities used were 2.8 and 1.8. The temperatures used were 1.8, 2.0, 2.2, 2.4 and 2.6. A timestep of 0.0025 was used because it gave accurate results without taking a long time to simulate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NVT ensemble. The densities used were 0.2 and 0.8. The temperatures used were 2.0, 2.2, 2.4, 2.6 and 2.8. The input file could be found in TASKS. A timestep of 0.0025 was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
It is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
&lt;br /&gt;
Integration of the VACF using the trapezium rule (&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(&amp;lt;/math&amp;gt;1st height&amp;lt;math&amp;gt;) + 2(&amp;lt;/math&amp;gt;sum of other heights&amp;lt;math&amp;gt;)_{n-1} + (&amp;lt;/math&amp;gt;last height&amp;lt;math&amp;gt;)_n]&amp;lt;/math&amp;gt;) can be used to calculate the diffusion coefficient using: &amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
The most useful timestep was found to be 0.0025 because it gives accurate results while not taking a long time to simulate. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. The integral of RDF in solid phase shows that there are 12 atoms that has a spacing of 1.025, 18 atoms with spacing of 1.475 and 42 atoms with a spacing of 1.825. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid. For future experiments, more than one atom type could be used to see the effect that it has on the RDF. Improvements could be made by using smaller trapeziums when integrating the VACF.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
[1] https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&lt;br /&gt;
[2]  http://lammps.sandia.gov&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Velocity Autocorrelation Function==&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634016</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634016"/>
		<updated>2017-10-25T10:27:27Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Simulations were ran on the LAMMPS application for LJ solids, liquids and vapours. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulation is &amp;quot;widely used to study a huge variety of chemical phenomena, from the behaviour of exotic materials under extreme conditions to protein folding and the properties of biological systems such as lipid membranes&amp;quot;.[1] This experiment is going to investigate how number density and heat capacity vary with temperature. The structure of solid, liquid and vapour phase will be determined using RDF and the diffusion coefficient will be calculated using MSD and VACF.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
All the simulations were ran through the LAMMPS application via the HPC portal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NpT ensemble. The densities used were 2.8 and 1.8. The temperatures used were 1.8, 2.0, 2.2, 2.4 and 2.6. A timestep of 0.0025 was used because it gave accurate results without taking a long time to simulate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NVT ensemble. The densities used were 0.2 and 0.8. The temperatures used were 2.0, 2.2, 2.4, 2.6 and 2.8. The input file could be found in TASKS. A timestep of 0.0025 was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
It is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
&lt;br /&gt;
Integration of the VACF using the trapezium rule (&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(&amp;lt;/math&amp;gt;1st height&amp;lt;math&amp;gt;) + 2(&amp;lt;/math&amp;gt;sum of other heights&amp;lt;math&amp;gt;)_{n-1} + (&amp;lt;/math&amp;gt;last height&amp;lt;math&amp;gt;)_n]&amp;lt;/math&amp;gt;) can be used to calculate the diffusion coefficient using: &amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
The most useful timestep was found to be 0.0025 because it gives accurate results while not taking a long time to simulate. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. The integral of RDF in solid phase shows that there are 12 atoms that has a spacing of 1.025, 18 atoms with spacing of 1.475 and 42 atoms with a spacing of 1.825. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid. For future experiments, more than one atom type could be used to see the effect that it has on the RDF. Improvements could be made by using smaller trapeziums when integrating the VACF.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
[1] https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&lt;br /&gt;
[2]  http://lammps.sandia.gov&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Velocity Autocorrelation Function==&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634012</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=634012"/>
		<updated>2017-10-25T10:26:21Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
Simulations were ran on the LAMMPS application for LJ solids, liquids and vapours. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid.&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Molecular dynamics simulation is &amp;quot;widely used to study a huge variety of chemical phenomena, from the behaviour of exotic materials under extreme conditions to protein folding and the properties of biological systems such as lipid membranes&amp;quot;.[1] This experiment is going to investigate how number density and heat capacity vary with temperature. The structure of solid, liquid and vapour phase will be determined using RDF and the diffusion coefficient will be calculated using MSD and VACF.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
All the simulations were ran through the LAMMPS application via the HPC portal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NpT ensemble. The densities used were 2.8 and 1.8. The temperatures used were 1.8, 2.0, 2.2, 2.4 and 2.6. A timestep of 0.0025 was used because it gave accurate results without taking a long time to simulate. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple cubic lattice was generated with 3375 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.0, under the NVT ensemble. The densities used were 0.2 and 0.8. The temperatures used were 2.0, 2.2, 2.4, 2.6 and 2.8. The input file could be found in TASKS. A timestep of 0.0025 was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same input file as the above was used.&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
It is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
&lt;br /&gt;
Integration of the VACF using the trapezium rule (&amp;lt;math&amp;gt;Area = {1\over 2}\times width \times [(&amp;lt;/math&amp;gt;1st height&amp;lt;math&amp;gt;) + 2(&amp;lt;/math&amp;gt;sum of other heights&amp;lt;math&amp;gt;)_{n-1} + (&amp;lt;/math&amp;gt;last height&amp;lt;math&amp;gt;)_n]&amp;lt;/math&amp;gt;) can be used to calculate the diffusion coefficient using: &amp;lt;math&amp;gt;D={1\over 3}\int_{0}^\infty C(\tau) d\tau&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
The most useful timestep was found to be 0.0025 because it gives accurate results while not taking a long time to simulate. The results show that there is a large discrepency between simulated and ideal density because it doesn&#039;t take into account the interactions between atoms. Denser materials have a higher heat capacity because there is more atoms to store energy. The RDF show that solids have a fixed lattice structure, liquids have a more dynamic shell and vapours only have shells at very close interatomic distances. The integral of RDF in solid phase shows that there are 12 atoms that has a spacing of 1.025, 18 atoms with spacing of 1.475 and 42 atoms with a spacing of 1.825. Through calculating diffusion coefficient using MSD and VACF, it shows that D for vapour&amp;gt;liquid&amp;gt;solid. For future experiments, more than one atom type could be used to see the effect that it has on the RDF. Improvements could be made by using smaller trapeziums when integrating the VACF.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
[1] https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Velocity Autocorrelation Function==&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633825</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633825"/>
		<updated>2017-10-25T08:11:21Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
Calculate diffusion coefficient using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2, under the NVT ensemble. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.002 was used because it gave accurate results and didn&#039;t take a long time to simulate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633812</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633812"/>
		<updated>2017-10-25T07:56:06Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equation of state is given by: &amp;lt;math&amp;gt;\rho=\frac{N}{V}=\frac{P}{k_{B}T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An ideal gas is considered to have no interatomic interactions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Heat capacity is given by: &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
RDF provides information about the distances of the nearest neighbour, second nearest neighbour and etc relative to a certain origin in a solid lattice. The integral of the RDF gives the coordination number, the number of identical atoms with the same lattice spacing from the origin.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Mean Squared Displacement, MSD, is the average distance moved by an atom. It can be used to calculate the diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;, using: &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
Calculate diffusion coefficient using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2, under the NVT ensemble. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.002 was used because it gave accurate results and didn&#039;t take a long time to simulate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Equation of State:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Heat Capacity:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Structural Properties and the Radial Distribution Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Dynamical Properties and the Diffusion Coefficient:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation of the diffusion coefficient, &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Velocity Autocorrelation Function:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&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!):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&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 &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633769</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633769"/>
		<updated>2017-10-25T07:03:53Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Report=&lt;br /&gt;
==Abstract==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
The position of a classical harmonic oscillator is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;x(t) = Acos(\omega t + \phi)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By differentiating &amp;lt;math&amp;gt;x(t)&amp;lt;/math&amp;gt; with respect to time, it gives the velocity: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; v(t) = \frac{dx(t)}{dt} = -A\omega sin(\omega t + \phi) &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The velocity autocorrelation function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \left\langle \mathbf{v}\left(t\right) \cdot \mathbf{v}\left(t+\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The normalised function is given by: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting the velocity into the normalised function, it gives: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega (t + \tau) + \phi) \, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the sine addition formula for &amp;lt;math&amp;gt; t + \tau &amp;lt;/math&amp;gt;, it gives:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; C(\tau ) = \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)(sin(\omega t + \phi)cos(\omega \tau) + sin(\omega \tau) cos(\omega t + \phi))\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = cos(\omega \tau) \, + \, \frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{\int_{-\infty}^{\infty} sin(\omega t + \phi)sin(\omega \tau) cos(\omega t + \phi)\, dt}{\int_{-\infty}^{\infty} (sin(\omega t + \phi))^{2} \, dt} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C(\tau ) = cos(\omega \tau) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; can be calculated by integrating the VACF:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aims and Objectives==&lt;br /&gt;
&lt;br /&gt;
Calculate diffusion coefficient using the velocity autocorrelation function.&lt;br /&gt;
&lt;br /&gt;
==Methods==&lt;br /&gt;
&lt;br /&gt;
For the solid phase, a face-centered cubic lattice was generated with 8000 atoms of mass 1.0, in a LJ forcefield with a cut-off distance of 3.2, under the NVT ensemble. A density of 1.2 and temperature of 1.0 was used.&lt;br /&gt;
&lt;br /&gt;
For the liquid and vapour phase, a simple cubic lattice was generated under the same parameters except for density, with a value of 0.8 and 0.01 respectively.&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.002 was used because it gave accurate results and didn&#039;t take a long time to simulate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Results and Discussion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In essence, this function tells us how different the velocity of an atom will be at time &amp;lt;math&amp;gt;t + \tau&amp;lt;/math&amp;gt; to its velocity at time &amp;lt;math&amp;gt;t&amp;lt;/math&amp;gt;. At long times, we expect &amp;lt;math&amp;gt;C\left(\infty\right) = 0&amp;lt;/math&amp;gt;, because the velocities of atoms should become &#039;&#039;uncorrelated&#039;&#039; at very long times. By this, we mean that the velocity of an atom at a particular time should not depend on its velocity a long time in the past &amp;amp;mdash; the exact form of &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; tells us how long &amp;quot;a long time&amp;quot; is. Remarkably, we can calculate the diffusion coefficient by integrating this function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;optional output-3&amp;quot; file from your simulations contains measurements of the VACF. The format of the files is similar to the format of the MSD data files: the first column contains the timestep at which the VACF data was evaluated (this is &amp;lt;math&amp;gt;\tau&amp;lt;/math&amp;gt;, in timestep units), the next three contain &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; for the Cartesian components of the velocity, and the final column contains the VACF for the whole velocity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot &amp;lt;math&amp;gt;C\left(\tau\right)&amp;lt;/math&amp;gt; with &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt; and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:VACF against harmonic jkt115.JPG|700px|center|thumb| VACF against number of timesteps]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF plot represents the collision with other atoms. In solid phase, the atoms can&#039;t move around and can only vibrate because there will be a restoring force, as shown by the fluctuations. However, in liquid phase, atoms can move around so there won&#039;t be much restoring force to move it back in place, as shown by the rapid damping of the velocity.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is different to the LJ solid and liquid because it doesn&#039;t take external forces from other atoms into account. It only considers an single atom that has a restoring force that is proportional to its displacement from the equilibrium position.&lt;br /&gt;
  &lt;br /&gt;
&#039;&#039;&#039;&amp;lt;big&amp;gt;TASK&amp;lt;/big&amp;gt;: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:VACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:VACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:VACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1MVACF solid jkt115.png ‎|upright=1.2|thumb|Running integral of VACF against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1MVACF liquid jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1MVACF vapour jkt115.png|upright=1.2|thumb|Running integral of VACF against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 1.57x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.19x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 6.82&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|4.79x10&amp;lt;sup&amp;gt;-5&amp;lt;/sup&amp;gt; ||9.27x10&amp;lt;sup&amp;gt;-2&amp;lt;/sup&amp;gt; || 3.49&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These values are as expected because &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; is greatest for vapour phase then liquid and solid for the same reasons as above.&lt;br /&gt;
&lt;br /&gt;
The largest source of error in the estimate of &amp;lt;math&amp;gt; D &amp;lt;/math&amp;gt; for VACF will be the use of the trapezium rule, therefore some areas will not be accounted for, leading to a smaller than expected value. The accuracy can be increased by using smaller trapeziums.&lt;br /&gt;
==Conclusion==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=TASKS=&lt;br /&gt;
==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D 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;
These are for 8000 atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure14:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:Liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure15:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:Vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure16:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
MSD is the average distance moved by an atom therefore, it is expected that the vapour phase will have the highest MSD because atoms are able to move freely. Solid phase has the lowest MSD because atoms are fixed in a lattice therefore there won&#039;t be much movement except for thermal vibrations. Liquid state has MSD values that are higher than but close to solids because it is able to move around but has similar density than solids.&lt;br /&gt;
&lt;br /&gt;
The increase in MSD is parabolic initially for vapour phase because there is no collision due to its low density but it turns linear when collisions start to happen. Liquid phase&#039;s MSD increases linearly because it has similar density to solids so there is a lot of collisions as it travels. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are for 1 million atoms:&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:1M solid MSD jkt115.JPG ‎|upright=1.2|thumb|&#039;&#039;&#039;Figure17:&#039;&#039;&#039; Total MSD against number of timesteps for solid phase]] &lt;br /&gt;
|[[File:1M liquid MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure18:&#039;&#039;&#039; Total MSD against number of timesteps for liquid phase]]&lt;br /&gt;
|[[File:1M vapour MSD jkt115.JPG|upright=1.2|thumb|&#039;&#039;&#039;Figure19:&#039;&#039;&#039; Total MSD against number of timesteps for vapour phase]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation with 1 million atoms has less fluctuation because the MSD are averaged over a lot more atoms, resulting in a more accurate representation.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left: auto; margin-right: auto; border: none;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Number of Atoms !!=&amp;quot;col&amp;quot; | Solid  !!=&amp;quot;col&amp;quot; | Liquid !! =&amp;quot;col&amp;quot; | Vapour&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 8000&lt;br /&gt;
| 9.57x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; || 1.33x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 8.07x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; | 1 million&lt;br /&gt;
|8.78x10&amp;lt;sup&amp;gt;-9&amp;lt;/sup&amp;gt; ||1.67x10&amp;lt;sup&amp;gt;-4&amp;lt;/sup&amp;gt; || 5.08x10&amp;lt;sup&amp;gt;-3&amp;lt;/sup&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_vapour_jkt115.png&amp;diff=633763</id>
		<title>File:1MVACF vapour jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_vapour_jkt115.png&amp;diff=633763"/>
		<updated>2017-10-25T06:37:51Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_liquid_jkt115.png&amp;diff=633762</id>
		<title>File:1MVACF liquid jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_liquid_jkt115.png&amp;diff=633762"/>
		<updated>2017-10-25T06:37:38Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_solid_jkt115.png&amp;diff=633761</id>
		<title>File:1MVACF solid jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1MVACF_solid_jkt115.png&amp;diff=633761"/>
		<updated>2017-10-25T06:37:25Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_vapour_jkt115.png&amp;diff=633737</id>
		<title>File:VACF vapour jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_vapour_jkt115.png&amp;diff=633737"/>
		<updated>2017-10-25T06:20:22Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_liquid_jkt115.png&amp;diff=633736</id>
		<title>File:VACF liquid jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_liquid_jkt115.png&amp;diff=633736"/>
		<updated>2017-10-25T06:20:05Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_solid_jkt115.png&amp;diff=633734</id>
		<title>File:VACF solid jkt115.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_solid_jkt115.png&amp;diff=633734"/>
		<updated>2017-10-25T06:19:19Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_against_harmonic_jkt115.JPG&amp;diff=633687</id>
		<title>File:VACF against harmonic jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:VACF_against_harmonic_jkt115.JPG&amp;diff=633687"/>
		<updated>2017-10-25T05:29:48Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633538</id>
		<title>File:FCC lattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633538"/>
		<updated>2017-10-25T02:00:08Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:FCC lattice.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633537</id>
		<title>File:FCC lattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633537"/>
		<updated>2017-10-25T01:59:10Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:FCC lattice.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633534</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633534"/>
		<updated>2017-10-25T01:58:15Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Analytical jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 1:&#039;&#039;&#039; Analytical position against time]]&lt;br /&gt;
&lt;br /&gt;
[[File:Energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 2:&#039;&#039;&#039; Energy against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Error jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 3:&#039;&#039;&#039; Error against time]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Timestep jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 4:&#039;&#039;&#039; Energy against time for timestep of 0.0025]]&lt;br /&gt;
&lt;br /&gt;
A timestep of 0.0025 was used. It is important to monitor the total energy because of conservation of energy, therefore total energy should be constant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(1.2,1.1,0.7\right) = \left(0.2,0.1,0.7\right) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;margin: 0 auto;&amp;quot;&lt;br /&gt;
|[[File:Energy time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure5:&#039;&#039;&#039; Energy against time for 0.001 timestep]] &lt;br /&gt;
|[[File:Temp time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure6:&#039;&#039;&#039; Temperature against time for 0.001 timestep]]&lt;br /&gt;
|[[File:Pressure time(0.001) jkt115.JPG |upright=1.2|thumb|&#039;&#039;&#039;Figure7:&#039;&#039;&#039; Pressure against time for 0.001 timestep.]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium in a time of 0.4.&lt;br /&gt;
&lt;br /&gt;
[[File:Compile energy jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 8:&#039;&#039;&#039; Energy against time for 5 different timesteps]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01. The 0.015 timestep was a bad choice because it doesn&#039;t converge and the total energy kept increasing.&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Simulation ideal2p5T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 9:&#039;&#039;&#039; Density against temperature at P=2.8 and P=1.8]]&lt;br /&gt;
&lt;br /&gt;
The simulated density was lower than because it takes the LJ pair potential between atoms into account, therefore atoms can&#039;t be as close together as an ideal gas. The discrepancy increases with pressure because LJ pair potential increases when distance between atoms decreases therefore, there will be a higher repulsive force when the atoms are closer together due to higher pressure.&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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Cv T jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 10:&#039;&#039;&#039; Cv/V against temperature at D=0.2 and D=0.8]]&lt;br /&gt;
&lt;br /&gt;
It is expected that heat capacity will increase with density because there is more molecules in the same volume so more energy can be stored. It is also expected that the heat capacity decreases with temperature because at higher temperature, higher energy levels starts getting occupied therefore the system won&#039;t be able to store as much energy.&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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:Combined RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 11:&#039;&#039;&#039; RDF against distance for solid, liquid and vapour phase]]&lt;br /&gt;
&lt;br /&gt;
Solid phase&#039;s RDF fluctuates because it has an ordered structure so the atoms remain in roughly the same place relative to a certain origin and form distinct shells. The peaks refers to the location of lattice points in a face-centered cubic lattice. The RDF decreases with distance because the number of atoms in the shell increases at a slower rate than the increase in volume.&lt;br /&gt;
&lt;br /&gt;
Liquid phase&#039;s RDF fluctuates less than solids because it has a less ordered structure and atoms are able to move around therefore the shells are less distinct and more spaced out.&lt;br /&gt;
&lt;br /&gt;
In the vapour phase, atoms are not ordered and far apart therefore only one initial peak is shown because LJ pair potential only has a significant effect on small internuclear distances. At higher internuclear distances, RDF=1 because of the random movement of atoms.&lt;br /&gt;
&lt;br /&gt;
[[File:Integral RDF jkt115.JPG|700px|thumb|center| &#039;&#039;&#039;Figure 12:&#039;&#039;&#039; Integral of RDF against distance for solid, liquid and vapour phase (Zoomed in)]]&lt;br /&gt;
&lt;br /&gt;
[[File:FCC lattice.png|300px|thumb|center| &#039;&#039;&#039;Figure 13:&#039;&#039;&#039; FCC lattice]]&lt;br /&gt;
&lt;br /&gt;
The first peak corresponds to atom A, with a lattice spacing of 1.025 and a coordination number of 12. The second peak corresponds to atom B, with a lattice spacing of 1.475 and a coordination number of 18. The third peak corresponds to atom C, with a lattice spacing of 1.825 and a coordination number of 42.&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.&#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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;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. 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>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633533</id>
		<title>File:FCC lattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633533"/>
		<updated>2017-10-25T01:57:58Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:FCC lattice.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_RDF_jkt115.JPG&amp;diff=633510</id>
		<title>File:Integral RDF jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Integral_RDF_jkt115.JPG&amp;diff=633510"/>
		<updated>2017-10-25T01:11:14Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633444</id>
		<title>File:FCC lattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:FCC_lattice.png&amp;diff=633444"/>
		<updated>2017-10-25T00:13:48Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_liquid_MSD_jkt115.JPG&amp;diff=633281</id>
		<title>File:1M liquid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_liquid_MSD_jkt115.JPG&amp;diff=633281"/>
		<updated>2017-10-24T22:07:34Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:1M liquid MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_solid_MSD_jkt115.JPG&amp;diff=633279</id>
		<title>File:1M solid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_solid_MSD_jkt115.JPG&amp;diff=633279"/>
		<updated>2017-10-24T22:07:06Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:1M solid MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_vapour_MSD_jkt115.JPG&amp;diff=633277</id>
		<title>File:1M vapour MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_vapour_MSD_jkt115.JPG&amp;diff=633277"/>
		<updated>2017-10-24T22:06:47Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:1M vapour MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_MSD_jkt115.JPG&amp;diff=633266</id>
		<title>File:Liquid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_MSD_jkt115.JPG&amp;diff=633266"/>
		<updated>2017-10-24T22:04:04Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:Liquid MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_MSD_jkt115.JPG&amp;diff=633262</id>
		<title>File:Solid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_MSD_jkt115.JPG&amp;diff=633262"/>
		<updated>2017-10-24T22:03:06Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:Solid MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_MSD_jkt115.JPG&amp;diff=633260</id>
		<title>File:Vapour MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_MSD_jkt115.JPG&amp;diff=633260"/>
		<updated>2017-10-24T22:02:38Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: Jkt115 uploaded a new version of File:Vapour MSD jkt115.JPG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Combined_RDF_jkt115.JPG&amp;diff=633223</id>
		<title>File:Combined RDF jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Combined_RDF_jkt115.JPG&amp;diff=633223"/>
		<updated>2017-10-24T21:47:44Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633059</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=633059"/>
		<updated>2017-10-24T19:22:00Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by &amp;lt;math&amp;gt;x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt; (the values of &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\omega&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\phi&amp;lt;/math&amp;gt; are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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.&#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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;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. 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>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_MSD_jkt115.JPG&amp;diff=632939</id>
		<title>File:Vapour MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour_MSD_jkt115.JPG&amp;diff=632939"/>
		<updated>2017-10-24T16:17:45Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Timestep_jkt115.JPG&amp;diff=632938</id>
		<title>File:Timestep jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Timestep_jkt115.JPG&amp;diff=632938"/>
		<updated>2017-10-24T16:17:24Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Temp_time(0.001)_jkt115.JPG&amp;diff=632937</id>
		<title>File:Temp time(0.001) jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Temp_time(0.001)_jkt115.JPG&amp;diff=632937"/>
		<updated>2017-10-24T16:17:09Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_MSD_jkt115.JPG&amp;diff=632936</id>
		<title>File:Solid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_MSD_jkt115.JPG&amp;diff=632936"/>
		<updated>2017-10-24T16:16:54Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Simulation_ideal2p5T_jkt115.JPG&amp;diff=632935</id>
		<title>File:Simulation ideal2p5T jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Simulation_ideal2p5T_jkt115.JPG&amp;diff=632935"/>
		<updated>2017-10-24T16:16:38Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Pressure_time(0.001)_jkt115.JPG&amp;diff=632934</id>
		<title>File:Pressure time(0.001) jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Pressure_time(0.001)_jkt115.JPG&amp;diff=632934"/>
		<updated>2017-10-24T16:16:19Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_MSD_jkt115.JPG&amp;diff=632933</id>
		<title>File:Liquid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_MSD_jkt115.JPG&amp;diff=632933"/>
		<updated>2017-10-24T16:16:02Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_jkt115.JPG&amp;diff=632932</id>
		<title>File:Error jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Error_jkt115.JPG&amp;diff=632932"/>
		<updated>2017-10-24T16:15:44Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Energy_time(0.001)_jkt115.JPG&amp;diff=632931</id>
		<title>File:Energy time(0.001) jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Energy_time(0.001)_jkt115.JPG&amp;diff=632931"/>
		<updated>2017-10-24T16:15:29Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Energy_jkt115.JPG&amp;diff=632930</id>
		<title>File:Energy jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Energy_jkt115.JPG&amp;diff=632930"/>
		<updated>2017-10-24T16:15:09Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Cv_T_jkt115.JPG&amp;diff=632929</id>
		<title>File:Cv T jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Cv_T_jkt115.JPG&amp;diff=632929"/>
		<updated>2017-10-24T16:14:51Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Compile_energy_jkt115.JPG&amp;diff=632928</id>
		<title>File:Compile energy jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Compile_energy_jkt115.JPG&amp;diff=632928"/>
		<updated>2017-10-24T16:14:21Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Combined_MSD_jkt115.JPG&amp;diff=632927</id>
		<title>File:Combined MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Combined_MSD_jkt115.JPG&amp;diff=632927"/>
		<updated>2017-10-24T16:13:56Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Analytical_jkt115.JPG&amp;diff=632926</id>
		<title>File:Analytical jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Analytical_jkt115.JPG&amp;diff=632926"/>
		<updated>2017-10-24T16:13:36Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_vapour_MSD_jkt115.JPG&amp;diff=632925</id>
		<title>File:1M vapour MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_vapour_MSD_jkt115.JPG&amp;diff=632925"/>
		<updated>2017-10-24T16:13:20Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_solid_MSD_jkt115.JPG&amp;diff=632924</id>
		<title>File:1M solid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_solid_MSD_jkt115.JPG&amp;diff=632924"/>
		<updated>2017-10-24T16:13:05Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_liquid_MSD_jkt115.JPG&amp;diff=632923</id>
		<title>File:1M liquid MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_liquid_MSD_jkt115.JPG&amp;diff=632923"/>
		<updated>2017-10-24T16:12:41Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_combined_MSD_jkt115.JPG&amp;diff=632922</id>
		<title>File:1M combined MSD jkt115.JPG</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1M_combined_MSD_jkt115.JPG&amp;diff=632922"/>
		<updated>2017-10-24T16:12:11Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632641</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632641"/>
		<updated>2017-10-24T03:27:52Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by x\left(t\right) = A\cos\left(\omega t + \phi\right) (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r^* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T^* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When two atoms are generated close together, there will be a very high repulsive force because potential increases exponentially as the distance between the atoms approaches zero. This will lead to particles having a very highly velocity so unless there is a very small timestep, the simulation won&#039;t be able to model the 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 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In a simple cubic lattice, there is only 1 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; D = \frac{N}{L^3} = \frac{1}{1.07722^3} = 0.800 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In a face-centred cubic lattice, there is 4 lattice point per unit cell, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; L = \left (\frac{4}{1.2}\right )^{\frac{1}{3}} = 1.494 &amp;lt;/math&amp;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;
&lt;br /&gt;
The create_atom command will create 4000 atoms because there is 4x the lattice point per unit cell.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
mass 1 1.0 = Atom type 1 with a mass of 1.0 in reduced units&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0 = Lennard-Jones Potential between atoms with no coulombic interactions and a cut-off distance of 3.0&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0 = Pairwise force field coefficient between all types of atoms is 1.0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying &amp;lt;math&amp;gt;\mathbf{x}_i\left(0\right)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathbf{v}_i\left(0\right)&amp;lt;/math&amp;gt;, which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Velocity-Verlet integration algorithm will be used because the initial postion and velocity is specified.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By defining the variable &amp;quot;timestep&amp;quot;, the number of simulation that it will run will change automatically according to the change in timestep, while keeping the total time constant.&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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&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 &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen &amp;lt;math&amp;gt;\left(p, T\right)&amp;lt;/math&amp;gt; points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: We need to choose &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature is correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if we multiply every velocity &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;. We can write two equations:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Solve these to determine &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;  \gamma^2 \frac{1}{2}  \sum_i m_i v_i^2 = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \gamma^2 \frac{3}{2}Nk_B T = \frac{3}{2} Nk_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\gamma = \left (\frac{\mathfrak{T}}{T} \right )^{\frac{1}{2}}&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. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
100 = Nevery = Use input values every 100 timesteps&lt;br /&gt;
&lt;br /&gt;
1000 = Nrepeat = Number of times to use input value to calculate averages&lt;br /&gt;
&lt;br /&gt;
100000 = Nfreq = Calculate averages every 10000 steps&lt;br /&gt;
&lt;br /&gt;
Because each timestep is 0.0025, therefore the simulation will run for 250.&lt;br /&gt;
&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 &amp;lt;math&amp;gt;\left(\frac{N}{V}\right)&amp;lt;/math&amp;gt;. Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==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 &amp;lt;math&amp;gt;\left(\rho^*, T^*\right)&amp;lt;/math&amp;gt; phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 variable D equal 0.2&lt;br /&gt;
 &lt;br /&gt;
 ### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
 lattice sc ${D}&lt;br /&gt;
 region box block 0 15 0 15 0 15&lt;br /&gt;
 create_box 1 box&lt;br /&gt;
 create_atoms 1 box&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
 mass 1 1.0&lt;br /&gt;
 pair_style lj/cut/opt 3.0&lt;br /&gt;
 pair_coeff 1 1 1.0 1.0&lt;br /&gt;
 neighbor 2.0 bin&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;###&amp;lt;/nowiki&amp;gt; SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
 variable T equal 2.0&lt;br /&gt;
 variable p equal 2.5&lt;br /&gt;
 variable timestep equal 0.0025&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
 velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY ENSEMBLE ###&lt;br /&gt;
 timestep ${timestep}&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
    &lt;br /&gt;
 ### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
 thermo_style custom time etotal temp press&lt;br /&gt;
 thermo 10&lt;br /&gt;
    &lt;br /&gt;
 ### RECORD TRAJECTORY ###&lt;br /&gt;
 dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
    &lt;br /&gt;
 ### SPECIFY TIMESTEP ###&lt;br /&gt;
    &lt;br /&gt;
 ### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
 variable tdamp equal ${timestep}*100&lt;br /&gt;
 variable pdamp equal ${timestep}*1000&lt;br /&gt;
 fix nvt all nvt temp ${T} ${T} ${tdamp} # system simulated in nvt with a specific density&lt;br /&gt;
 run 10000&lt;br /&gt;
 unfix nvt&lt;br /&gt;
 fix nve all nve&lt;br /&gt;
 reset_timestep 0&lt;br /&gt;
    &lt;br /&gt;
 ### MEASURE SYSTEM STATE ###&lt;br /&gt;
 thermo_style custom step etotal temp press density atoms&lt;br /&gt;
 variable dens equal density&lt;br /&gt;
 variable dens2 equal density*density&lt;br /&gt;
 variable temp equal temp&lt;br /&gt;
 variable temp2 equal temp*temp&lt;br /&gt;
 variable press equal press&lt;br /&gt;
 variable press2 equal press*press&lt;br /&gt;
 variable energy equal etotal&lt;br /&gt;
 variable energy2 equal etotal*etotal&lt;br /&gt;
 variable no_atoms2 equal atoms*atoms&lt;br /&gt;
 fix aves all ave/time 50 2000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_energy v_energy2&lt;br /&gt;
 run 100000&lt;br /&gt;
    &lt;br /&gt;
 variable avedens equal f_aves[1]&lt;br /&gt;
 variable avetemp equal f_aves[2]&lt;br /&gt;
 variable avepress equal f_aves[3]&lt;br /&gt;
 variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
 variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
 variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
 variable heatcap equal ${no_atoms2}*((f_aves[8]-(f_aves[7]*f_aves[7]))/f_aves[5])&lt;br /&gt;
    &lt;br /&gt;
 print &amp;quot;Averages&amp;quot;&lt;br /&gt;
 print &amp;quot;--------&amp;quot;&lt;br /&gt;
 print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
 print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
 print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
 print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
 print &amp;quot;heatcap: ${heatcap}&amp;quot;&amp;lt;/nowiki&amp;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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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.&#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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;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. 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>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632296</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632296"/>
		<updated>2017-10-23T01:42:14Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by x\left(t\right) = A\cos\left(\omega t + \phi\right) (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of molecules in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r} = \frac{1} {18} = 0.0555 mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;N = n\times N_A = 0.0555\times 6.022\times 10^{23} = 3.34 \times 10^{22} molecules&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Volume of 10000 water molecules:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{N} {N_A} = \frac{10000} {6.022\times 10^{23}} = 1.66\times 10^{-20} mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;m = n \times M_r = 1.66 \times 10^{-20} \times 18 = 2.99 \times 10^{-19} g = 2.99 \times 10^{-19} ml&amp;lt;/math&amp;gt; because density of water is 1g/ml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; in a cubic simulation box which runs from &amp;lt;math&amp;gt;\left(0, 0, 0\right)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;\left(1, 1, 1\right)&amp;lt;/math&amp;gt;. In a single timestep, it moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt;. At what point does it end up, &#039;&#039;after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After periodic boundary conditions have been applied, the new position is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\left(0.5,0.5,0.5\right) + \left(0.7,0.6,0.2\right) = \left(0.2,0.1,0.7\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The LJ cutoff distance in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r = r* \times \sigma = 3.2 \times 0.34 \times 10^{-9}= 1.09 \times 10^{-9} m&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon = 120 \times k_B = \frac {1.66 \times 10^{-21} \times 6.02 \times 10^{23}} {1000} = 0.997 kJ mol^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The temperature in real units:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; T = \frac{T* \epsilon}{k_B} = \frac{1.5 \times 1.66 \times 10^{-21}}{1.38 \times 10^{-23}} = 180 K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&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 T^* = 1.5), 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 \left(p, T\right) 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: 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;
&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 \left(\frac{N}{V}\right). 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 \left(\rho^*, T^*\right) phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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.&#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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;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. 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>Jkt115</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632295</id>
		<title>Rep:MOD:jkt115</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:MOD:jkt115&amp;diff=632295"/>
		<updated>2017-10-23T01:08:39Z</updated>

		<summary type="html">&lt;p&gt;Jkt115: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
&#039;&#039;&#039;TASK: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns &amp;quot;ANALYTICAL&amp;quot;, &amp;quot;ERROR&amp;quot;, and &amp;quot;ENERGY&amp;quot;: &amp;quot;ANALYTICAL&amp;quot; should contain the value of the classical solution for the position at time t, &amp;quot;ERROR&amp;quot; should contain the absolute difference between &amp;quot;ANALYTICAL&amp;quot; and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and &amp;quot;ENERGY&amp;quot; should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by x\left(t\right) = A\cos\left(\omega t + \phi\right) (the values of A, \omega, and \phi are worked out for you in the sheet).&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your &amp;quot;simulation&amp;quot;? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK:For a single Lennard-Jones interaction, &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;, find the separation, &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt;, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt;, and work out the well depth (&amp;lt;math&amp;gt;\phi\left(r_{eq}\right)&amp;lt;/math&amp;gt;). Evaluate the integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{12} \over r_o^{12}}-{\sigma^{6} \over r_o^{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_o^{12}} =\frac{\sigma^6}{r_o^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma^{6}} = {r_o^6} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the force at this separation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F=-\frac{d\phi(r)}{dr}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi &#039; = 4\epsilon \left ( -\frac{12\sigma^{12}}{r^{13}} + \frac{6\sigma^6}{r^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Because &amp;lt;math&amp;gt;{\sigma} = {r_o} &amp;lt;/math&amp;gt; , therefore&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{\sigma^{13}} + \frac{6\sigma^6}{\sigma^7} \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = \frac{24\epsilon}{\sigma} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
At equilibrium, the net force will be zero therefore:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; F = -4\epsilon \left ( -\frac{12\sigma^{12}}{r_{eq}^{13}} + \frac{6\sigma^{6}}{r_{eq}^7} \right ) = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \frac{12\sigma^{12}}{r_{eq}^{13}} = \frac{6\sigma^6}{r_{eq}^7} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_{eq}^6 = 2 \sigma^6&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; r_{eq} = 2^{\frac{1}{6}} \sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To work out the well depth:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{r_{eq}^{12}} - \frac{\sigma^6}{r_{eq}^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\phi (r_{eq}) = 4\epsilon \left ( \frac{\sigma^{12}}{4\sigma^{12}} - \frac{\sigma^6}{2\sigma^6} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = 4\epsilon \left ( \frac{1}{4} - \frac{1}{2} \right ) &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt; \phi (r_{eq}) = -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Evaluation of the integrals:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2^{5}\sigma^{5}}     \right ] = -0.0248 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{2.5\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{2.5^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{2.5^{5}\sigma^{5}}     \right ] = -0.00817&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^{\infty} \phi(r) dr = \left [   -\frac{4r^{-11}}{11}  +  \frac{4r^{-5}}{5}  \right ]^{\infty}_{3\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;=  \left [   \frac{4}{11} \frac{1}{3^{11} \sigma^{11}} - \frac{4}{5} \frac{1}{3^{5}\sigma^{5}}     \right ] = -0.00329 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Number of moles in 1ml of water:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;n = \frac{m} {M_r}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider an atom at position \left(0.5, 0.5, 0.5\right) in a cubic simulation box which runs from \left(0, 0, 0\right) to \left(1, 1, 1\right). In a single timestep, it moves along the vector \left(0.7, 0.6, 0.2\right). At what point does it end up, after the periodic boundary conditions have been applied?.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: The Lennard-Jones parameters for argon are \sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}. If the LJ cutoff is r^* = 3.2, what is it in real units? What is the well depth in \mathrm{kJ\ mol}^{-1}? What is the reduced temperature T^* = 1.5 in real units?&#039;&#039;&#039;&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&#039;&#039;&#039;TASK: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Using the LAMMPS manual, find the purpose of the following commands in the input script:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut 3.0&lt;br /&gt;
pair_coeff * * 1.0 1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;TASK: Given that we are specifying \mathbf{x}_i\left(0\right) and \mathbf{v}_i\left(0\right), which integration algorithm are we going to use?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;TASK: Look at the lines below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;The second line (starting &amp;quot;variable timestep...&amp;quot;) tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&#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). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?&#039;&#039;&#039;&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 T^* = 1.5), 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 \left(p, T\right) 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: 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;
&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 \left(\frac{N}{V}\right). 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 \left(\rho^*, T^*\right) phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0, 2.2, 2.4, 2.6, 2.8. Plot C_V/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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 g(r) and \int g(r)\mathrm{d}r. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==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.&#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 D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;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;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. 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>Jkt115</name></author>
	</entry>
</feed>