<?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=Al3214</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=Al3214"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Al3214"/>
	<updated>2026-05-15T20:34:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572208</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572208"/>
		<updated>2016-12-02T11:29:51Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 18: Radial distribution functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
The radial distribution plots for solid, liquid and gas can be seen below.&lt;br /&gt;
&lt;br /&gt;
For this simulation, a face centred cubic lattice was used and the values for the density and temperature were chosen according to the phase diagram of a Lennard-Jones system.&amp;lt;ref name=&amp;quot;lennardJ&amp;quot;/&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
All plots start at zero as the potential interaction, which an atom experiences from others at a position x=0 from itself, is zero.&lt;br /&gt;
&lt;br /&gt;
As the distance from that atom is increased there is an increasing probability of encountering other atoms. &lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
In a gas, due to the free motion of the atoms around the simulation box, the RDf function goes the fastest to zero. For the liquid as there is a reduce in motion and an increase of the atoms to be fixed to the lattice structure the first peak quickly flattens out. &lt;br /&gt;
Finally, for a solid, due to the fixed nature of the atoms to the lattice sites, the RDF peaks can be related to the distance to the nearest neighbours, which in this case are 1.025, 1.775 and 2.675 as shown on the plot below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;lennardJ&amp;quot;/&amp;gt; Hansen, J.-P., &amp;amp; Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. Phys. Rev., 184(1), 151–161. http://doi.org/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572206</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572206"/>
		<updated>2016-12-02T11:28:20Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
The radial distribution plots for solid, liquid and gas can be seen below.&lt;br /&gt;
For this simulation, a face centred cubic lattice was used and the values for the density and temperature were chosen according to the phase diagram of a Lennard-Jones system.&amp;lt;ref name=&amp;quot;lennardJ&amp;quot;/&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
All plots start at zero as the potential interaction, which an atom experiences from others at a position x=0 from itself, is zero. As the distance from that atom is increased there is an increasing probability of encountering other atoms. &lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
In a gas, due to the free motion of the atoms around the simulation box, the RDf function goes the fastest to zero. For the liquid as there is a reduce in motion and an increase of the atoms to be fixed to the lattice structure the first peak quickly flattens out. &lt;br /&gt;
Finally, for a solid, due to the fixed nature of the atoms to the lattice sites, the RDF peaks can be related to the distance to the nearest neighbours, which in this case are 1.025, 1.775 and 2.675 as shown on the plot below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;lennardJ&amp;quot;/&amp;gt; Hansen, J.-P., &amp;amp; Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. Phys. Rev., 184(1), 151–161. http://doi.org/10.1103/PhysRev.184.151&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572202</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572202"/>
		<updated>2016-12-02T11:25:50Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 18: Radial distribution functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
The radial distribution plots for solid, liquid and gas can be seen below.&lt;br /&gt;
For this simulation, a face centred cubic lattice was used and the values for the density and temperature were chosen according to the phase diagram of a Lennard-Jones system.&amp;lt;ref name=&amp;quot;lennardJ&amp;quot;/&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
All plots start at zero as the potential interaction, which an atom experiences from others at a position x=0 from itself, is zero. As the distance from that atom is increased there is an increasing probability of encountering other atoms. &lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
In a gas, due to the free motion of the atoms around the simulation box, the RDf function goes the fastest to zero. For the liquid as there is a reduce in motion and an increase of the atoms to be fixed to the lattice structure the first peak quickly flattens out. &lt;br /&gt;
Finally, for a solid, due to the fixed nature of the atoms to the lattice sites, the RDF peaks can be related to the distance to the nearest neighbours, which in this case are 1.025, 1.775 and 2.675 as shown on the plot below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;br /&gt;
&amp;lt;ref name=&amp;quot;phasediagram&amp;quot;&amp;gt; Hansen, J.-P., &amp;amp; Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. Phys. Rev., 184(1), 151–161. http://doi.org/10.1103/PhysRev.184.151&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572201</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572201"/>
		<updated>2016-12-02T11:24:23Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
The radial distribution plots for solid, liquid and gas can be seen below.&lt;br /&gt;
For this simulation, a face centred cubic lattice was used and the values for the density and temperature were chosen according to the phase diagram of a Lennard-Jones system. &lt;br /&gt;
All plots start at zero as the potential interaction, which an atom experiences from others at a position x=0 from itself, is zero. As the distance from that atom is increased there is an increasing probability of encountering other atoms. &lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
In a gas, due to the free motion of the atoms around the simulation box, the RDf function goes the fastest to zero. For the liquid as there is a reduce in motion and an increase of the atoms to be fixed to the lattice structure the first peak quickly flattens out. &lt;br /&gt;
Finally, for a solid, due to the fixed nature of the atoms to the lattice sites, the RDF peaks can be related to the distance to the nearest neighbours, which in this case are 1.025, 1.775 and 2.675 as shown on the plot below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;br /&gt;
&amp;lt;ref name=&amp;quot;phasediagram&amp;quot;&amp;gt; Hansen, J.-P., &amp;amp; Verlet, L. (1969). Phase Transitions of the Lennard-Jones System. Phys. Rev., 184(1), 151–161. http://doi.org/10.1103/PhysRev.184.151&amp;lt;/ref&amp;gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572197</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572197"/>
		<updated>2016-12-02T11:23:00Z</updated>

		<summary type="html">&lt;p&gt;Al3214: ui&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
The radial distribution plots for solid, liquid and gas can be seen below.&lt;br /&gt;
For this simulation, a face centred cubic lattice was used and the values for the density and temperature were chosen according to the phase diagram of a Lennard-Jones system. &lt;br /&gt;
All plots start at zero as the potential interaction, which an atom experiences from others at a position x=0 from itself, is zero. As the distance from that atom is increased there is an increasing probability of encountering other atoms. &lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
In a gas, due to the free motion of the atoms around the simulation box, the RDf function goes the fastest to zero. For the liquid as there is a reduce in motion and an increase of the atoms to be fixed to the lattice structure the first peak quickly flattens out. &lt;br /&gt;
Finally, for a solid, due to the fixed nature of the atoms to the lattice sites, the RDF peaks can be related to the distance to the nearest neighbours, which in this case are 1.025, 1.775 and 2.675 as shown on the plot below. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572157</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572157"/>
		<updated>2016-12-02T11:04:43Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 18: Radial distribution functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png|thumb|500px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:Nearest_neighboursal32143214.png|thumb|500px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Nearest_neighboursal32143214.png&amp;diff=572149</id>
		<title>File:Nearest neighboursal32143214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Nearest_neighboursal32143214.png&amp;diff=572149"/>
		<updated>2016-12-02T11:02:35Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572140</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572140"/>
		<updated>2016-12-02T10:54:21Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ D from MSD plots.&lt;br /&gt;
!&lt;br /&gt;
!Solid &lt;br /&gt;
!Liquid &lt;br /&gt;
!Gas&lt;br /&gt;
|-&lt;br /&gt;
|Millions&lt;br /&gt;
|8.33E-9&lt;br /&gt;
|1.66E-4&lt;br /&gt;
|0.005&lt;br /&gt;
|-&lt;br /&gt;
|fcc&lt;br /&gt;
|1.16E-9&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00303&lt;br /&gt;
|-&lt;br /&gt;
|sq lat&lt;br /&gt;
|3.3E-6&lt;br /&gt;
|0.0011&lt;br /&gt;
|0.00302&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
There are two trends than can be inferred from the MDS plots.&lt;br /&gt;
*The diffusion coefficient increases when going from a solid phase to a liquid or a gas. &lt;br /&gt;
*The greater the density of the lattice, fcc with 4 atoms per simulation box, the lower the diffusion coefficient. &lt;br /&gt;
&lt;br /&gt;
Under the same density conditions of the ensemble, the intrinsic density of an square lattice with 1 atom per simulation box, causes it to have an MSD plot which resembles after a liquid more than after a solid.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572118</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572118"/>
		<updated>2016-12-02T10:30:53Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 12: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12: Understanding the code===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation.&lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
the Mean Squared Displacement was initally calculated for liquid, solid and vapour phases of an square lattice crystal.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572115</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572115"/>
		<updated>2016-12-02T10:30:15Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|thumb|900px|]]&lt;br /&gt;
&lt;br /&gt;
The MSD was plotted as seen on the images on the right. Fronm those plots, the gradient was calculated and divided by 6 to give D, the diffusion coefficient. the results are summarized in the following table: &lt;br /&gt;
the Mean Squared Displacement was initally calculated for liquid, solid and vapour phases of an square lattice crystal.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572074</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572074"/>
		<updated>2016-12-02T09:31:04Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572070</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572070"/>
		<updated>2016-12-02T09:29:32Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572067</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572067"/>
		<updated>2016-12-02T09:29:06Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572066</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572066"/>
		<updated>2016-12-02T09:28:14Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;references&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition&amp;quot;&amp;gt; I. Klotz, R. Roseberg, Chemical Thermodynamics, Basic Theory and Methods, John Wiley &amp;amp; Sons, 2000&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;/references&amp;gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572058</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572058"/>
		<updated>2016-12-02T09:17:34Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572057</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572057"/>
		<updated>2016-12-02T09:16:53Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition1&amp;quot;/&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition 1&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572055</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572055"/>
		<updated>2016-12-02T09:16:14Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition 1&amp;quot; /&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&amp;lt;ref name=&amp;quot;definition 1&amp;quot;&amp;gt;&amp;lt;/ref&amp;gt;Peter Atkins, Julio de Paula, Atkins Physical Chemistry, Oxford 2008.&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572049</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=572049"/>
		<updated>2016-12-02T09:11:54Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
&lt;br /&gt;
From the plot above it can be seen that a temperature increase causes a decrease in heat capacity. &lt;br /&gt;
&lt;br /&gt;
The reasoning behind this trend is that because the simulation establishes  a certain lattice structure there is a constraint on the positions of the atoms. This constraint stops the atoms from gaining free energy. At constant volume the heat capacity can be written as &amp;lt;math&amp;gt; C_V = (\frac{dU}{dT})_V&amp;lt;/math&amp;gt; &amp;lt;ref name=&amp;quot;definition 1&amp;quot; /&amp;gt; . Consequently if the increase in internal energy is not greater that the temperature increase the heat capacity will decrease.&lt;br /&gt;
 &lt;br /&gt;
A change in density changes the volume of the lattice cells, as calculated in Task . At higher densities the heat capacity of the system increases. This is due to  the lattice cells being more effectively filled and hence more atoms per area  can potentially increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571772</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571772"/>
		<updated>2016-12-02T00:28:40Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 21: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
A temperature increase can be seen to cause a decrease in heat capacity.  Because the simulations are run for a square lattice crystal the positions of the atoms are to an extent constraint, therefore they do not have the capacity to absorb heat and increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571770</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571770"/>
		<updated>2016-12-02T00:28:23Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 20: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
A temperature increase can be seen to cause a decrease in heat capacity.  Because the simulations are run for a square lattice crystal the positions of the atoms are to an extent constraint, therefore they do not have the capacity to absorb heat and increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571768</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571768"/>
		<updated>2016-12-02T00:28:06Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
For this simulation a file was created  [[File:Log_file.rtf|input file]]&lt;br /&gt;
A temperature increase can be seen to cause a decrease in heat capacity.  Because the simulations are run for a square lattice crystal the positions of the atoms are to an extent constraint, therefore they do not have the capacity to absorb heat and increase their internal energy.&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Log_file.rtf&amp;diff=571765</id>
		<title>File:Log file.rtf</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Log_file.rtf&amp;diff=571765"/>
		<updated>2016-12-02T00:23:44Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571759</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571759"/>
		<updated>2016-12-02T00:17:32Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 16: Editing the equations of state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs above  show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571757</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571757"/>
		<updated>2016-12-02T00:15:33Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|left|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs on the left show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571755</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571755"/>
		<updated>2016-12-02T00:14:53Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 16: Editing the equations of state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|left|caption|Variation of density with temperature at different pressures (blue). The orange line represents the behaviour of a perfect gas]]&lt;br /&gt;
 &lt;br /&gt;
The graphs on the left show the change in density with respect to temperature. These simulations of ensembles were run at a time-step of 0.0025 that as shown in Task 1 ensures that the energy of the system does not fluctuate more than 1%. From these graphs several conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
- An increase in temperature causes a decrease in density. &lt;br /&gt;
&lt;br /&gt;
- An increase in pressure causes an increase in density.&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571739</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571739"/>
		<updated>2016-12-01T23:47:02Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 16:editing the equations of state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16: Editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png|right|]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571730</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571730"/>
		<updated>2016-12-01T23:25:05Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 15: Numbers 100 1000 100000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;First&#039;&#039;&#039;: Use the input values &#039;&#039;&#039;every&#039;&#039;&#039; this number of time steps.&lt;br /&gt;
*&#039;&#039;&#039;Second&#039;&#039;&#039;: number of times to &#039;&#039;&#039;repeat&#039;&#039;&#039; the input values for calculating the averages.&lt;br /&gt;
*&#039;&#039;&#039;Third&#039;&#039;&#039;: To calculate averages for this &#039;&#039;&#039;frequency&#039;&#039;&#039; of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571728</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571728"/>
		<updated>2016-12-01T23:22:53Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 15: Numbers 100 1000 100000 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*First: Use the input values every this number of time steps.&lt;br /&gt;
*Second: number of times to use input values for calculating  the averages.&lt;br /&gt;
*Third: To calculate averages for this number of timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571714</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571714"/>
		<updated>2016-12-01T22:56:03Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Tasks 1,2 and 3: Velocity-Verlet algorithm: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The variation of the position of an atom was calculated using the classical harmonic oscillator approach and the Velocity-Verlet algorithm. Image 1 shows the difference between the two methods. &lt;br /&gt;
The orange line traces de maximum error peaks. It can be seen that these maximum errors increase linearly (&amp;lt;math&amp;gt; y= 2*10^{-5}x + 3*10^{5}&amp;lt;/math&amp;gt;) with time. The reason behind this is that the simulation of each time-step requires that of the previous one, so the error builds up. &lt;br /&gt;
&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
For the following simulations, since the energy of an ensemble should be constant over time we needed to find the value of the time-step that would give the lowest standard deviation in order words, the least energy fluctuations. The following table shows that 0.03 gives a 1% STD. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ Energy Fluctuation with time.&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571687</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571687"/>
		<updated>2016-12-01T22:22:30Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png|900px|]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571486</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571486"/>
		<updated>2016-12-01T19:45:26Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 20:===&lt;br /&gt;
===Task 21:===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571480</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571480"/>
		<updated>2016-12-01T19:43:34Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 19: Mean Squared Displacement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;br /&gt;
[[File:Allal3214.png]]&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Allal3214.png&amp;diff=571479</id>
		<title>File:Allal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Allal3214.png&amp;diff=571479"/>
		<updated>2016-12-01T19:43:20Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_sqlattice.png&amp;diff=571466</id>
		<title>File:Solid sqlattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_sqlattice.png&amp;diff=571466"/>
		<updated>2016-12-01T19:31:12Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_sqlattice.png&amp;diff=571462</id>
		<title>File:Liquid sqlattice.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_sqlattice.png&amp;diff=571462"/>
		<updated>2016-12-01T19:30:06Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas_sqlatticeal3214.png&amp;diff=571461</id>
		<title>File:Gas sqlatticeal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas_sqlatticeal3214.png&amp;diff=571461"/>
		<updated>2016-12-01T19:29:36Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_fccal3214.png&amp;diff=571460</id>
		<title>File:Solid fccal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid_fccal3214.png&amp;diff=571460"/>
		<updated>2016-12-01T19:28:59Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_fccal3214.png&amp;diff=571458</id>
		<title>File:Liquid fccal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid_fccal3214.png&amp;diff=571458"/>
		<updated>2016-12-01T19:27:48Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas_fccal3214.png&amp;diff=571456</id>
		<title>File:Gas fccal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Gas_fccal3214.png&amp;diff=571456"/>
		<updated>2016-12-01T19:27:18Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_solidal3214.png&amp;diff=571453</id>
		<title>File:Millions solidal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_solidal3214.png&amp;diff=571453"/>
		<updated>2016-12-01T19:26:18Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_liquidal3214.png&amp;diff=571450</id>
		<title>File:Millions liquidal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_liquidal3214.png&amp;diff=571450"/>
		<updated>2016-12-01T19:25:04Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_gasal3214.png&amp;diff=571449</id>
		<title>File:Millions gasal3214.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Millions_gasal3214.png&amp;diff=571449"/>
		<updated>2016-12-01T19:24:01Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571443</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571443"/>
		<updated>2016-12-01T19:21:29Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 18: Radial distribution functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 19: Mean Squared Displacement===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDf%2BintRDFal3214analo.png&amp;diff=571397</id>
		<title>File:RDf+intRDFal3214analo.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDf%2BintRDFal3214analo.png&amp;diff=571397"/>
		<updated>2016-12-01T18:44:00Z</updated>

		<summary type="html">&lt;p&gt;Al3214: Al3214 uploaded a new version of File:RDf+intRDFal3214analo.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571392</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571392"/>
		<updated>2016-12-01T18:38:57Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 17: Heat Capacities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;br /&gt;
[[File:Heat_capacity_with_T_analo.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 18: Radial distribution functions===&lt;br /&gt;
[[File:RDf+intRDFal3214analo.png]]&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDf%2BintRDFal3214analo.png&amp;diff=571391</id>
		<title>File:RDf+intRDFal3214analo.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDf%2BintRDFal3214analo.png&amp;diff=571391"/>
		<updated>2016-12-01T18:38:36Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacity_with_T_analo.png&amp;diff=571364</id>
		<title>File:Heat capacity with T analo.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacity_with_T_analo.png&amp;diff=571364"/>
		<updated>2016-12-01T18:06:00Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571314</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571314"/>
		<updated>2016-12-01T17:05:35Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 16:editing the equations of state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;br /&gt;
&lt;br /&gt;
===Task 17: Heat Capacities===&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571304</id>
		<title>Rep:Mod:AL3214</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:AL3214&amp;diff=571304"/>
		<updated>2016-12-01T16:57:29Z</updated>

		<summary type="html">&lt;p&gt;Al3214: /* Task 16:editing the equations of state */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Molecular dynamics simulation =&lt;br /&gt;
&lt;br /&gt;
=== Tasks 1,2 and 3: Velocity-Verlet algorithm: ===&lt;br /&gt;
&lt;br /&gt;
:The image below shows the incapability of using large time-steps in the Velocity-Verlet approximation,as the error increases over time. This can be appreciated in Table 1.&lt;br /&gt;
:A time-step smaller by a factor of 10, 0.01, reduces enormously the error. This can be seen on the following image where the the line connecting the maximum peaks from the previous time-step has been kept. Consequently the larger the time-step, the less accurate the measurements will be. &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+ The table&#039;s caption&lt;br /&gt;
!Time-step&lt;br /&gt;
!Standard deviation&lt;br /&gt;
|-&lt;br /&gt;
|0.1&lt;br /&gt;
|0.18&lt;br /&gt;
|-&lt;br /&gt;
|0.01&lt;br /&gt;
|0.17&lt;br /&gt;
|-&lt;br /&gt;
|0.001&lt;br /&gt;
|0.003&lt;br /&gt;
|-&lt;br /&gt;
|0.002&lt;br /&gt;
|0.012&lt;br /&gt;
|}&lt;br /&gt;
[[File:Al3214error.jpg|800px||alt=Alt text|Caption text]]&lt;br /&gt;
&lt;br /&gt;
=== Task 4: Lennard Jones Potential:===&lt;br /&gt;
:*&#039;&#039;&#039;Finding &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; at which the potential is zero&#039;&#039;&#039;:&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)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: Since &amp;lt;math&amp;gt;\phi\left(r_o\right)= 0 &amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; 4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::And: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\sigma^{12}}{r_0^{12}} = \frac{\sigma^6}{r_0^6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6} r_0^{12} = \sigma^{12} r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{1}{\sigma^{6}} = \frac{1}{r_0^{6}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \sigma^{6}= r_0^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;Finally &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Force at seperation at &amp;lt;math&amp;gt;r_0&amp;lt;/math&amp;gt; equal to  &amp;lt;math&amp;gt; \frac{d(\phi\left(r_0\right))}{dr_0}&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; \frac{\sigma^{6}}{\sigma^{12}} = \frac{r_0^{6}}{r_0^{12}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt; F = \frac{-4\epsilon\sigma^{12}12}{r_0^{13}} + \frac{4\epsilon\sigma^{6}6}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon\sigma^{12}}{r_0^{13}} + \frac{24\epsilon\sigma^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Since &amp;lt;math&amp;gt; \sigma= r_0&amp;lt;/math&amp;gt; at this point&#039;&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon r_0^{12}}{r_0^{13}} + \frac{24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-48\epsilon+24\epsilon r_0^{6}}{r_0^{7}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;F=\frac{-24\epsilon}{r_0}&amp;lt;/math&amp;gt; or &amp;lt;math&amp;gt;F=\frac{-24\epsilon}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:*&#039;&#039;&#039;Finding the equilibrium separation:&#039;&#039;&#039;&lt;br /&gt;
: The equilibrium separation &amp;lt;math&amp;gt; r_{eq}&amp;lt;/math&amp;gt; corresponds to the energy minimum of the Lennard Jones potential curve. As it is the minimum it will be a solution of  equating the first derivative of &amp;lt;math&amp;gt;\phi\left(r\right)&amp;lt;/math&amp;gt; to zero. &lt;br /&gt;
:Calculating  &amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr}&amp;lt;/math&amp;gt; and knowing it has to equal to zero. &lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt; \frac{d(\phi\left(r\right))}{dr} = \frac{-48\epsilon \sigma^{12}}{r^{13}} + \frac{24\epsilon \sigma^{6}}{r^{7}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7}}{r^{20}} + \frac{24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{-48\epsilon \sigma^{12} r^{7} +24\epsilon \sigma^{6}r^{13}}{r^{20}}&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;\frac{-24\epsilon \sigma^{6} r^{7}(-2\sigma^{6}+r^{6})}{r^{20}} = 0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;(-2\sigma^{6}+r^{6})=0&amp;lt;/math&amp;gt;&lt;br /&gt;
::&amp;lt;math&amp;gt;2\sigma^{6}=r^{6}&amp;lt;/math&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;&amp;lt;math&amp;gt; r_{eq}=\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:* Now the well depth can be found &lt;br /&gt;
::&amp;lt;math&amp;gt; \phi(r_{eq}) =4\epsilon( \frac{\sigma^{12}}{\sqrt[6]{2}^{12}\sigma^{12}} - \frac{\sigma^6}{\sqrt[6]{2}^{6}\sigma^{6}})  &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt; 4\epsilon( \frac{1}{2^{2}} - \frac{1}{2})  &amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt; 4\epsilon( \frac{-1}{4})  &amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt; -\epsilon &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Evaluating 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;. With values of  &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r = \int_{2\sigma}^\infty\mathrm{4\epsilon \left( \frac{\sigma^{12}}{r_0^{12}} - \frac{\sigma^6}{r_0^6} \right)d}r = [ \frac{1}{4}(-\frac{\sigma^{12}}{11*2^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2^{5}\sigma^{5}})]^{\infty}_{2\sigma} &amp;lt;/math&amp;gt; = &amp;lt;math&amp;gt;\frac{1}{4}(-\frac{1^{12}}{11*2^{11}1^{11}}+\frac{1^{6}}{5*2^{5}1^{5}})= -0.0248&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:The same process was followed for the other integrals:&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*2.5^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*2.5^{5}\sigma^{5}})= -0.00818&amp;lt;/math&amp;gt;&lt;br /&gt;
:&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r = -\frac{1}{4}\epsilon(-\frac{\sigma^{12}}{11*3^{11}\sigma^{11}}+\frac{\sigma^{6}}{5*3^{5}\sigma^{5}})= -0.00329&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5: Number of water molecules in 1ml of water  and volume of 1000 water molecules===&lt;br /&gt;
:1mL of water equals 1 gr of water. Dividing this gram by 18.01528 g/mol, the molar density of water we get 0.0555 mol of water. Finally  by multiplying by Avogadro&#039;s number we find that there are  &amp;lt;math&amp;gt;3.34228 10^{22}&amp;lt;/math&amp;gt; molecules of water in 1 mL. &lt;br /&gt;
: Proportionally, 10000 molecules will occupy a volume of &amp;lt;math&amp;gt;2.991*10^{-19}&amp;lt;/math&amp;gt; mL.&lt;br /&gt;
&lt;br /&gt;
=== Task 6: ===&lt;br /&gt;
: An atom at position &amp;lt;math&amp;gt;\left(0.5, 0.5, 0.5\right)&amp;lt;/math&amp;gt; sits in a cubic simulation box of dimensions 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; with periodic boundary conditions. If this atom moves along the vector &amp;lt;math&amp;gt;\left(0.7, 0.6, 0.2\right)&amp;lt;/math&amp;gt; it will end up at &amp;lt;math&amp;gt;\left(0.2, 0.1, 0.7\right)&amp;lt;/math&amp;gt;.&lt;br /&gt;
 &lt;br /&gt;
=== Task 7: Reduced Units ===&lt;br /&gt;
&lt;br /&gt;
:The Lennard-Jones parameters for argon are &amp;lt;math&amp;gt;\sigma = 0.34\mathrm{nm}, \epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt;. If the LJ cutoff is &amp;lt;math&amp;gt;r^* = 3.2&amp;lt;/math&amp;gt;, what is it in real units? What is the well depth in &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;? What is the reduced temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt; in real units?&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&amp;lt;math&amp;gt;r = 1.088&amp;lt;/math&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;T = 180 K &amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;math&amp;gt;\epsilon\ = 0.014 {kJ\ mol}^{-1}&amp;lt;/math&amp;gt; &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Task 8: Density and lattice spacing===&lt;br /&gt;
: Using the formula for density:&lt;br /&gt;
::&amp;lt;math&amp;gt; \rho = \frac{m}{V}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;=\frac{1}{1.077^{3}}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;= 0.79999\approx 0.8&amp;lt;/math&amp;gt;&lt;br /&gt;
: If we consider a fcc lattice, (4 atoms per unit cell), with density of 1.2 and using the formula above: &lt;br /&gt;
::&amp;lt;math&amp;gt; 1.2 = \frac{4}{x^{3}}&amp;lt;/math&amp;gt;&lt;br /&gt;
:Where x is the side length of a unit cell&lt;br /&gt;
::&amp;lt;math&amp;gt; x=\sqrt[3]{\frac{4}{1.2}}\approx 1.275&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 9 Number of atoms with an fcc lattice===&lt;br /&gt;
With the established set-up, 1000 unit cells are created. If an fcc lattice had been chosen 1000 unit cells would have also been formed each containing 4 atoms which add up to a total of 4000 atoms.&lt;br /&gt;
&lt;br /&gt;
===Task 10: Input script commands. ===&lt;br /&gt;
:The commands are used to determine the properties of the atoms.&lt;br /&gt;
&amp;lt;pre&amp;gt; mass 1 1.0&amp;lt;/pre&amp;gt; Sets the mass for all atoms of type 1 to a value of 1.0. It is worth remembering that for this simulation only 1 atom type has been used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt; Calculates the coulombic pairwise interaction of two neighbouring atoms as the distance increases between them until a maximum of  0.3 in the Lennard-Jones potential.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff * * 1.0 1.0&amp;lt;/pre&amp;gt; Specifies the pairwise force field coefficients between atoms pairs. The asterisks indicate that all atoms types from 1 to N will have a value of 1.&lt;br /&gt;
&lt;br /&gt;
===Task 11: Integration algorithm ===&lt;br /&gt;
&lt;br /&gt;
By 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;, we are using the Velocity-Verlet algorithm.&lt;br /&gt;
&lt;br /&gt;
===Task 12:===&lt;br /&gt;
&amp;lt;pre&amp;gt;variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
variable n_steps equal floor(100/0.001)&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
timestep 0.001&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The code above is used to constrain the number of steps depending on the time-step. &lt;br /&gt;
This is easily visualized by choosing two different time-steps: &lt;br /&gt;
&lt;br /&gt;
::timestep equal 0.001 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 100000&lt;br /&gt;
::timestep equal 0.002 &amp;lt;math&amp;gt;\implies&amp;lt;/math&amp;gt; n_steps = 50000&lt;br /&gt;
&lt;br /&gt;
:The two time-steps have different number of steps but the sum of the time-steps is constant and its 100.&lt;br /&gt;
:In other words, the number of &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&#039;s in the Velocity Verlet algorithm is different but their sum is constant.&lt;br /&gt;
:This sum of the time-steps is not dependent on the actual duration of the simulation. &lt;br /&gt;
&lt;br /&gt;
===Task 13: Variation of Energy, Pressure and Temperature plots with the time-step.===&lt;br /&gt;
[[File:Stabilisation_at_0.001.png]]&lt;br /&gt;
[[File:Energy stabilistion timestep.png]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Image that for a 0.001 times-step the simulation reaches equilibrium at around 0.02. Although pressure and temperature fluctuate throughout the simulation the energy remains constant with a standard deviation of___ that was previously calculated.This result was therefore expected. &lt;br /&gt;
&lt;br /&gt;
If we know compare the effect of the time-step on the energy the following conclusions can be drawn:&lt;br /&gt;
&lt;br /&gt;
* The larger the time-step, the less accurate the Velocity-Verlet algorithm, choosign a larger time-step causes the error to increase&lt;br /&gt;
* Both 0.001 and 0.0025 give accurate energy readings but choosing 0.0025 will allow the simulations to run for longer. &lt;br /&gt;
* Above 0.003 The standard deviation of the energy increases to &lt;br /&gt;
* 0.015 as a time step does not reach an energy stabilisation. &amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In view of the above, the simulations will be run for both 0.001 and 0.0025 as time-steps.&lt;br /&gt;
&lt;br /&gt;
===Task 14: Determining &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;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;
To achieve &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; every &amp;lt;math&amp;gt; v_i &amp;lt;/math&amp;gt; has to be multiplied by &amp;lt;math&amp;gt;\gamma&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;
:&amp;lt;math&amp;gt;\gamma^2\frac{1}{2}\sum_i m_i \left(\ v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Substituting  &amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 &amp;lt;/math&amp;gt;:&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma^2\frac{3}{2}N k_B T = \frac{3}{2}N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cancelling and rearranging leads us to: &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\gamma = \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Task 15: Numbers 100 1000 100000 ===&lt;br /&gt;
Nevery Nrepeat Nfreq &lt;br /&gt;
*use input values every this many timesteps&lt;br /&gt;
*of times to use input values for calculating averages&lt;br /&gt;
*calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
===Task 16:editing the equations of state===&lt;br /&gt;
[[File:0.0025uploadIdGasANA.png]]&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:0.0025uploadIdGasANA.png&amp;diff=571303</id>
		<title>File:0.0025uploadIdGasANA.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:0.0025uploadIdGasANA.png&amp;diff=571303"/>
		<updated>2016-12-01T16:57:09Z</updated>

		<summary type="html">&lt;p&gt;Al3214: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Al3214</name></author>
	</entry>
</feed>