<?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=Zc2814</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=Zc2814"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Zc2814"/>
	<updated>2026-04-11T08:17:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696076</id>
		<title>Rep:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696076"/>
		<updated>2018-04-01T16:50:57Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Undo revision 695994 by Zc2814 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Periodic Boundary Conditions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Reduced Units===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth=&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
&lt;br /&gt;
===Creating the simulation box===&lt;br /&gt;
&lt;br /&gt;
Giving atoms random starting coordinates may make two atoms generated too close together. This will cause the two atoms to collide and arise the repulsion between the two atoms. The repulsive force between the atoms will drive them apart, leading to increase in the potential energy of the system and making it very unstable.&lt;br /&gt;
&lt;br /&gt;
A face-centered cubic lattice has 4 lattice points per unit cell. The side length of the cubic unit cell=&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If 1000 unit cells were generated by the create_atoms command, 4000 atoms would be generated for a FCC lattice.&lt;br /&gt;
&lt;br /&gt;
===Setting the properties of the atoms===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Mass 1 1.0&amp;lt;/pre&amp;gt; &lt;br /&gt;
This means the mass of the single type of atom is 1.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;Pair_style&amp;quot; indicates that the interaction is pairwise interaction. &amp;quot;lj.cut&amp;quot; describes the standard 12/6 Lennard-Jones potential without a Coulombic pairwise interaction. &amp;quot;3.0&amp;quot; indicates that the global cutoff for atoms is at 3.0.&lt;br /&gt;
&amp;lt;pre&amp;gt;Pair_coeff * *1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;quot;pair_coeff&amp;quot; specifies the pairwise force field coefficients. The two asterisks indicate that the command will apply to all atoms.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;x_i&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;v_i&amp;lt;/math&amp;gt;are specified,the Velocity-Verlet algorithm will be used for this simulation.&lt;br /&gt;
&lt;br /&gt;
===Running the simulation===&lt;br /&gt;
&lt;br /&gt;
The purpose of defining variable is that we don&#039;t need to manually change the numerical timestep each time the timestep needs to be changed. This reduces the human errors that may occur as the timestep only needs to be changed once to the value defined.&lt;br /&gt;
&lt;br /&gt;
===Checking equilibration===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 4a1.PNG|450px|thumb|left|Fig 4a:Total energy vs. time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4b1.PNG|450px|thumb|center|Fig 4b: Temperature vs Time at 0.001 timestep]]&lt;br /&gt;
||[[File:Fig 4c1.PNG|450px|thumb|right|Fig 4c: Pressure vs. Time at 0.001 timestep]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The simulation reaches equilibrium at 0.001 timestep as pressure and temperature become constant. It can be seen from pressure and temperature data that the simulation reaches equilibrium at t=0.29.The average pressure value is about 2.61 and the average temperature value is about 1.26.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 4d.PNG|500px|thumb|center|Fig.5: Graph of energies for all timesteps]]&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig 5 that the total energy produced by 0.0025 timestep are very close to those produced by 0.001 timestep. Simulations at 0.0075 and 0.01 also reach equilibrium but the total energies are higher than those produced by 0.001 timestep, thus these timesteps are not very accurate. Therefore the largest timestep to get acceptable results is 0.0025 and the worst choice is 0.015 timestep as the simulation doesn&#039;t reach equilibrium.&lt;br /&gt;
&lt;br /&gt;
==Running simulations under specific conditions==&lt;br /&gt;
===Barostat and Thermostat===&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Examining the Input Script===&lt;br /&gt;
The numbers 100 1000 100000 indicate the timesteps the input values will be used to compute the averages of density, pressure and temperature. For this simulation, the average will be calculated using values produced by timestep 100,200,...100000. Therefore, 1000 values will be used to calculate the average. The following line tells LAMMPS to run the simulation for 100000 timesteps. 0.0025 timestep will be used. Therefore 250 time units are simulated.&lt;br /&gt;
&lt;br /&gt;
===Plotting the Equations of State===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 5a.PNG|450px|thumb|left|Fig.6:Density vs Temperature and Ideal Gas law at p=2.3 and p=2.6]]&lt;br /&gt;
|[[File:Fig 6b.PNG|450px|thumb|left|Fig.7:Density calculated by Ideal Gas Law compared to LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable p equal 4&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp} &lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press atoms density vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable volume equal vol&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/f_aves[5]&lt;br /&gt;
variable CV equal ${heatcapacity}/${volume}&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Density: ${avedens}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errdens}&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
print &amp;quot;volume: ${volume}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity/volume: ${CV}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8a3.PNG|500px|thumb|center|Fig.8: Cv/V vs. temperature at densities 0.2 and 0.8]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{C_V}{V}&amp;lt;/math&amp;gt; was plotted against temperature. The volume for &amp;lt;math&amp;gt;\rho=0.2&amp;lt;/math&amp;gt; is 16875. The volume for &amp;lt;math&amp;gt;\rho=0.8&amp;lt;/math&amp;gt; is 4218.75. The heat capacity is inversely proportional to temperature from Fig.8, the same as shown in the equation &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
==Structural properties and the radial distribution function==&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 8.PNG|500px|thumb|left|Fig.9: g(r) vs. r for solid, liquid and gaseous phases ]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://journals.aps.org/pr/abstract/10.1103/PhysRev.184.151&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Phase&lt;br /&gt;
!Density&lt;br /&gt;
!Temperature&lt;br /&gt;
|-&lt;br /&gt;
|Vapour&lt;br /&gt;
|0.1&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Liquid&lt;br /&gt;
|0.8&lt;br /&gt;
|1.2&lt;br /&gt;
|-&lt;br /&gt;
|Solid&lt;br /&gt;
|1.6&lt;br /&gt;
|1.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1010.PNG|500px|thumb|center|Fig.10: Integral of g(r) vs. interatomic distance for solid phase ]]&lt;br /&gt;
&lt;br /&gt;
The coordination number for the first three peaks can be calculated from the plot of the integral of g(r) against interatomic distance. The integral of g(r) at the inflection points represent the coordination number of the three nearest neighbors. As a FCC lattice is used in a solid system, there should be 12 neighboring particles around each particle (shown at r=1.275). So the coordination number of the first peak is 12.  The next inflection number has a g(r) integral of 18. As it is a running integral, the coordination number of the second peak is &amp;lt;math&amp;gt;18-12=6&amp;lt;/math&amp;gt;. The coordination number of the third peak is &amp;lt;math&amp;gt;42-18=24&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Dynamical properties and the diffusion coefficient==&lt;br /&gt;
===Mean Squared Displacement===&lt;br /&gt;
The mean squared displacement is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;{\displaystyle {\rm {MSD}}\equiv \langle (x-x_{0})^{2}\rangle ={\frac {1}{N}}\sum _{n=1}^{N}(x_{n}(t)-x_{n}(0))^{2}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a1.PNG|450px|thumb|left|Fig 11a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 11a.PNG|450px|thumb|left|Fig 11b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12a.PNG|450px|thumb|left|Fig 11c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 10a.PNG|450px|thumb|left|Fig 12a: Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:Fig 10b.PNG|450px|thumb|left|Fig 12b: Gas simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:Fig 12b.PNG|450px|thumb|left|Fig 12c: Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All these plots are as expected. For the liquid phase, MSD is directly proportional to timestep, this is because the particles move in brownian motion. Foe gaseous phase, the first part (timestep 0-2000) is curved and the second part (above 2000) is linear. The curved part is because the particles move randomly in the system and the distance between them is very large. The frequency of collision between the particles is very low and thus the velocity of the atoms will be almost constant. The distance travelled per unit time is constant, thus MSD is proportional to &amp;lt;math&amp;gt;t^2&amp;lt;/math&amp;gt;. As longer time is simulated, collisions will occur more frequently and the motion can be described by brownian motion and MSD changes linearly with timestep. For solid phase, the particles only vibrate in fixed positions and do not have enough kinetic energy to diffuse, thus MSD reaches at constant value at around timestep 200.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is given by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta t=0.002&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For small system of 3375 atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0245}{0.002}=2.042&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For large system of 1 million atoms, the diffusion coefficient is:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.001}{0.002}=0.083&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{0.0305}{0.002}=2.542&amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D=\frac{1}{6} \times \frac{6 \times 10^{-8}}{0.002}=5 \times 10^{-6}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
All of the diffusion coefficients are in reduced units. The coefficients for the larger system were similar to the ones for the smaller system.&lt;br /&gt;
&lt;br /&gt;
===Velocity Autocorrelation Function===&lt;br /&gt;
The equation of the position of a 1D harmonic oscillator is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t) = A\cos(\omega t + \phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;v(t)=\frac{dx}{dt}&amp;lt;/math&amp;gt;, thus:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t) = \frac{d(Acos(\omega t +\phi)}{dt}=-A\omega sin(\omega t+\phi)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\tau)=-A\omega sin(\omega(t + \tau) +\phi) &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty} v(t)v(t + \tau)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2(t)\mathrm{d}t}= \frac{\int_{-\infty}^{\infty} -A\omega sin(\omega t+ \phi) \times -A\omega sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} (-A\omega sin(\omega t+\phi))^2\mathrm{d}t}=\frac{(A\omega)^2 \int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{(A\omega)^2 \int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{\int_{-\infty}^{\infty} sin(\omega t+\phi) sin(\omega(t + \tau) +\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(x+y)=sin(x)cos(y)+cos(x)sin(y)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = \frac{\int_{-\infty}^{\infty}sin(\omega t+\phi)[sin(\omega t+ \phi)cos(\omega \tau)+cos(\omega t+\phi)sin(\omega \tau)]\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}=\frac{cos(\omega \tau)\int_{-\infty}^{\infty}sin^2(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t} = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty}sin(\omega t+ \phi)cos(\omega t+\phi)\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since &amp;lt;math&amp;gt;sin(2x)=2sin(x)cos(x)&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau) = cos(\omega \tau)+\frac{sin(\omega \tau)\int_{-\infty}^{\infty} \frac{1}{2}sin(2(\omega t+ \phi))\mathrm{d}t}{\int_{-\infty}^{\infty} sin^2(\omega t+\phi)\mathrm{d}t}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;sin(x)&amp;lt;/math&amp;gt; is an odd function, the area above the x-axis and below the x-axis cancel out from negative infinity to positive infinity. Thus, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin(2(\omega t+\phi))=0&amp;lt;/math&amp;gt;. therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C(\tau)=cos(\omega \tau)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 13.PNG|500px|thumb|center|Fig.14: VACF for solid, liquid and 1D Harmonic Oscillator]]&lt;br /&gt;
&lt;br /&gt;
The minima in the VACF for the liquid system represent the collisions between the atoms and the solvent molecules and change in direction. The minima in the VACF for the solid system represent the collisions between the atoms and change in direction. The minima for the solid system is lower than the minima for the liquid system because of the stronger interatomic forces. The VACF for the liquid system only has one weak oscillation, this is because the atoms only interact with their closest neighbor. In the VACF for the solid system, there are more oscillations as the atoms can vibrate in fixed positions. The harmonic oscillator VACF is very different to the Lennard Jones liquid and solid as there are no interactions between the atoms so the atoms will always vibrate with constant velocity without loss in energy. Therefore, the amplitude doe not change.&lt;br /&gt;
&lt;br /&gt;
By applying the trapezium rule, integral under VACF can be calculated and running integral can be plotted:&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 15a1.PNG|450px|thumb|left|Fig.15a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 15b1.PNG|450px|thumb|left|Fig.15b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 15c.PNG|450px|thumb|left|Fig.15c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 16a1.PNG|450px|thumb|left|Fig.16a: running integral vs. time for liquid]]&lt;br /&gt;
||[[File:Fig 16b1.PNG|450px|thumb|left|Fig.16b: running integral vs. time for solid]]&lt;br /&gt;
||[[File:Fig 16c.PNG|450px|thumb|left|Fig.16c: running integral vs. time for gas]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient is calculated by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D = \frac{1}{3}\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last point of the running integral is &amp;lt;math&amp;gt;\int_0^\infty \mathrm{d}\tau \left\langle\mathbf{v}\left(0\right)\cdot\mathbf{v}\left(\tau\right)\right\rangle &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For 3375 atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2937=9.79 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 5.64 \times 10^{-4}=1.88 \times 10{-4}&amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 7.054=2.351&amp;lt;/math&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
For 1 million atoms:&lt;br /&gt;
Liquid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 0.2703=9.01 \times 10^{-2} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Solid: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 1.37 \times 10^{-4}=4.57 \times 10^{-5} &amp;lt;/math&amp;gt;;&lt;br /&gt;
Gas: &amp;lt;math&amp;gt;D= \frac{1}{3} \times 9.805=3.268&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The diffusion coefficient calculated from this method was largest for gas, followed by liquid and then gas. The coefficients for the larger system were very similar to the ones for the smaller system. The coefficients calculated by MSD were similar to the ones calculated by VACF for liquid and gas, but the coefficient calculated by VACF was larger than the one calculated by MSD for solid. The largest source of error may be that the trapezium rule overestimates the area under the solid curve as the timestep is not small enough.&lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696075</id>
		<title>Rep:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696075"/>
		<updated>2018-04-01T16:50:28Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Undo revision 696074 by Zc2814 (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable p equal 4&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta &lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696074</id>
		<title>Rep:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=696074"/>
		<updated>2018-04-01T16:43:40Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Theory===&lt;br /&gt;
&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable p equal 4&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta &lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=695994</id>
		<title>Rep:Modxl9814</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Modxl9814&amp;diff=695994"/>
		<updated>2018-03-28T10:59:44Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[==Theory==&lt;br /&gt;
===Velocity Verlet Algorithm===&lt;br /&gt;
One way to solve Newton&#039;s Second law F=ma is the velocity-Verlet algorithm. By using a Taylor expansion,the atomic positions, velocities and accelerations can be approximated at time t with good precision. The position of atom i, at time t, is denoted by &amp;lt;math&amp;gt;x_i (t)&amp;lt;/math&amp;gt; and the velocity of the atom at time t is denoted by &amp;lt;math&amp;gt;v_i (t)&amp;lt;/math&amp;gt;. Position at the next timestep &amp;lt;math&amp;gt;t+\delta t&amp;lt;/math&amp;gt; can be expressed by:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=x_i(t)+\frac{dx_i (t)}{dt}\delta t+\frac{1}{2!}\frac{d^2x_i (t)}{dt^2}\delta t^2+\frac{1}{3!}\frac{d^3x_i (t)}{dt^3}\delta t^3+\Omicron(\delta t^4)\quad (1) \quad &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A single timestep is expressed as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x(t+\delta t)=x_t+v_t \delta t+\frac{1}{2}a_t \delta t^2\quad (2) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v(t+\delta t)=x_t+\frac{1}{2}(a_{t+\delta t}+a_t)\delta t\quad (3) \quad&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 1.PNG|600x600px|thumb|center|Fig 1: Classically calculated positions vs. velocity verlet calculated positions]]&lt;br /&gt;
&lt;br /&gt;
The classical harmonic oscillator can be describe by &amp;lt;math&amp;gt;x(t)=Acos(\omega t+\phi)&amp;lt;/math&amp;gt;. The errors oscillate through 5 peaks in the simulated time. The plot of the total energy vs. time of the simulated system:&lt;br /&gt;
&lt;br /&gt;
[[File:Fig 2.PNG|600px|thumb|center|Fig 2:Error vs. time]]                                                                                     &lt;br /&gt;
&lt;br /&gt;
The cumulative error over a constant interval of time is given by:]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;error(x(t_0 +n\delta t))=\Omicron (\delta t^2)&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;https://www.saylor.org/site/wp-content/uploads/2011/06/MA221-6.1.pdf&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thus, it can be seen from this equation that the relation between the maxima of the error of the Velocity-Verlet algorithm and &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt; is quadratically increasing. The graph of the maxima of error vs. time therefore can be fit into the quadratic equation in figure 2.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The total energy of the oscillating system is the sum of the kinetic energy and the potential energy, with &amp;lt;math&amp;gt;E_k=\frac{1}{2}mv^2&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;E_p=\frac{1}{2}kx^2&amp;lt;/math&amp;gt;. In this case, m=1 and k=1, therefore the equation is &amp;lt;math&amp;gt;E=\frac{v^2+x^2}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:Fig 3a.PNG|600px|thumb|left|Fig 3a:Energy vs. Time at 0.1 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|[[File:Fig 3b.PNG|600px|thumb|left|Fig 3b:Energy vs. Time at 0.2 timestep with error limites of 0.5% on either side]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In order for the total energy not to change by more than 1% over the course of the &#039;&#039;simulation&#039;&#039;, the timestep needs to be 0.2. It is important to monitor the total energy of the system to ensure that energy conservation is obeyed, the same as the real system.&lt;br /&gt;
&lt;br /&gt;
===Atomic Forces===&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulations were conducted at temperatures 2,2.5,3,3.5,5 and pressures 2.3 and 2.6.&lt;br /&gt;
&lt;br /&gt;
Density can also be calculated by Ideal Gas Law &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fig.7 shows that the simulated density is much lower than the density obtained by the Ideal Gas Law. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity Calculation==&lt;br /&gt;
In the NVT ensemble, pressures (0.2,0.8) and temperatures (2,2.2,2.4,2.6,2.8) were used to calculate the heat capacity by using the following equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code to run the simulation in the NVT ensemble is as following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable p equal 4&lt;br /&gt;
variable timestep equal 0.0025&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;D=\frac{1}{6}\frac{\delta\langle r^2\rangle}{\delta t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\delta\langle r^2\rangle&amp;lt;/math&amp;gt; is the slope of the trendline of the mean squared displacement vs. timestep plot. The timestep &amp;lt;math&amp;gt;\delta &lt;br /&gt;
&lt;br /&gt;
==Reference==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDFSOL.png&amp;diff=695993</id>
		<title>File:RDFSOL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDFSOL.png&amp;diff=695993"/>
		<updated>2018-03-28T10:55:25Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Zc2814 uploaded a new version of File:RDFSOL.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695992</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695992"/>
		<updated>2018-03-28T10:54:31Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We enclose the atoms created in a cubic simulation &amp;quot;box&amp;quot; with fixed dimensions, and set the lattice type of the melting crystal and density of lattice unit. This can be related to realistic systems when applying this to e.g. water system:&lt;br /&gt;
&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble(&amp;lt;u&amp;gt;&#039;&#039;modified nvt.in is attached as appendix&#039;&#039;&amp;lt;/u&amp;gt;). Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states. The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order. The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:liquid222.png|250px|thumb|left|3375 atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:vapour222.png|250px|thumb|left|3375 atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:solid222.png|250px|thumb|left|3375 atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:1mmmliquid.png|250px|thumb|left|1 million atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:1mmmvapour.png|250px|thumb|left|1 million atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:1mmmsolid.png|250px|thumb|left|1 million atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid simulation corresponded to a real liquid as MSD increased linearly with simulation time as the atoms moved in Brownian motion. The vapour simulation was also linear for the most part as it also resembles a brownian motion. The first curve bit raised from the random collision of vapour atoms as they were very far apart and the probability, or frequency,  of collisions would be quite small. Thus needed some time to establish this statical equilibrium. For solid phase, atoms only move around a fixed position and the MSD reached constant average value at around 200 tilmestep. The simulation illustrated these information satisfyingly. By comparing 3375 atom system to 1 million atom system, clearly the 1 million system gave better stable results as there were more atoms and more collisions could be sampled and data would meet statistical requirement better.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Liquid system was simulated with enclosure simulation box under Lennard-Jones potential by velocity-Verlet algorithm. Suitable timestep 0.001 was evaluated while total energy, pressure and density changes with temperature were monitored. The outcome was quite satisfying with same trend and small value differences compared to other approximation methods e.g. Ideal Gas Law. The simulation method was then used to model vapour and solid. Radial distribution function g(r) and MSD was examined. Both parameters showed good representation of real systems and gave differences between liquid, vapour and solid phases. Therefore the simulation preformed in this experiment was satisfying.&lt;br /&gt;
&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable v equal 16875&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press vol&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press atoms density vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(1.38064852e-23*f_aves[5])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695991</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695991"/>
		<updated>2018-03-28T10:46:38Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Appendix &amp;amp; References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We enclose the atoms created in a cubic simulation &amp;quot;box&amp;quot; with fixed dimensions, and set the lattice type of the melting crystal and density of lattice unit. This can be related to realistic systems when applying this to e.g. water system:&lt;br /&gt;
&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble(&amp;lt;u&amp;gt;&#039;&#039;modified nvt.in is attached as appendix&#039;&#039;&amp;lt;/u&amp;gt;). Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states. The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order. The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:liquid222.png|250px|thumb|left|3375 atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:vapour222.png|250px|thumb|left|3375 atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:solid222.png|250px|thumb|left|3375 atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:1mmmliquid.png|250px|thumb|left|1 million atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:1mmmvapour.png|250px|thumb|left|1 million atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:1mmmsolid.png|250px|thumb|left|1 million atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid simulation corresponded to a real liquid as MSD increased linearly with simulation time as the atoms moved in Brownian motion. The vapour simulation was also linear for the most part as it also resembles a brownian motion. The first curve bit raised from the random collision of vapour atoms as they were very far apart and the probability, or frequency,  of collisions would be quite small. Thus needed some time to establish this statical equilibrium. For solid phase, atoms only move around a fixed position and the MSD reached constant average value at around 200 tilmestep. The simulation illustrated these information satisfyingly. By comparing 3375 atom system to 1 million atom system, clearly the 1 million system gave better stable results as there were more atoms and more collisions could be sampled and data would meet statistical requirement better.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;br /&gt;
&amp;lt;pre&amp;gt;variable density equal 0.2&lt;br /&gt;
&lt;br /&gt;
### DEFINE SIMULATION BOX GEOMETRY ###&lt;br /&gt;
lattice sc ${density}&lt;br /&gt;
region box block 0 15 0 15 0 15&lt;br /&gt;
create_box 1 box&lt;br /&gt;
create_atoms 1 box&lt;br /&gt;
&lt;br /&gt;
### DEFINE PHYSICAL PROPERTIES OF ATOMS ###&lt;br /&gt;
mass 1 1.0&lt;br /&gt;
pair_style lj/cut/opt 3.0&lt;br /&gt;
pair_coeff 1 1 1.0 1.0&lt;br /&gt;
neighbor 2.0 bin&lt;br /&gt;
&lt;br /&gt;
### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###&lt;br /&gt;
variable T equal 2.0&lt;br /&gt;
variable v equal 16875&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
&lt;br /&gt;
### ASSIGN ATOMIC VELOCITIES ###&lt;br /&gt;
velocity all create ${T} 12345 dist gaussian rot yes mom yes&lt;br /&gt;
&lt;br /&gt;
### SPECIFY ENSEMBLE ###&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
fix nve all nve&lt;br /&gt;
&lt;br /&gt;
### THERMODYNAMIC OUTPUT CONTROL ###&lt;br /&gt;
thermo_style custom time etotal temp press vol&lt;br /&gt;
thermo 10&lt;br /&gt;
&lt;br /&gt;
### RECORD TRAJECTORY ###&lt;br /&gt;
dump traj all custom 1000 output-1 id x y z&lt;br /&gt;
&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION TO MELT CRYSTAL ###&lt;br /&gt;
run 10000&lt;br /&gt;
unfix nve&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### BRING SYSTEM TO REQUIRED STATE ###&lt;br /&gt;
variable tdamp equal ${timestep}*100&lt;br /&gt;
variable pdamp equal ${timestep}*1000&lt;br /&gt;
fix nvt all nvt temp ${T} ${T} ${tdamp}&lt;br /&gt;
run 10000&lt;br /&gt;
reset_timestep 0&lt;br /&gt;
&lt;br /&gt;
### MEASURE SYSTEM STATE ###&lt;br /&gt;
thermo_style custom step etotal temp press atoms density vol&lt;br /&gt;
variable dens equal density&lt;br /&gt;
variable dens2 equal density*density&lt;br /&gt;
variable temp equal temp&lt;br /&gt;
variable temp2 equal temp*temp&lt;br /&gt;
variable press equal press&lt;br /&gt;
variable press2 equal press*press&lt;br /&gt;
variable N equal atoms&lt;br /&gt;
variable N2 equal atoms*atoms&lt;br /&gt;
variable E equal etotal&lt;br /&gt;
variable E2 equal etotal*etotal&lt;br /&gt;
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2 v_E v_E2&lt;br /&gt;
unfix nvt&lt;br /&gt;
fix nve all nve&lt;br /&gt;
run 100000&lt;br /&gt;
&lt;br /&gt;
variable avedens equal f_aves[1]&lt;br /&gt;
variable avetemp equal f_aves[2]&lt;br /&gt;
variable avepress equal f_aves[3]&lt;br /&gt;
variable errdens equal sqrt(f_aves[4]-f_aves[1]*f_aves[1])&lt;br /&gt;
variable errtemp equal sqrt(f_aves[5]-f_aves[2]*f_aves[2])&lt;br /&gt;
variable errpress equal sqrt(f_aves[6]-f_aves[3]*f_aves[3])&lt;br /&gt;
variable heatcapacity equal ${N2}*(f_aves[8]-f_aves[7]*f_aves[7])/(1.38064852e-23*f_aves[5])&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Averages&amp;quot;&lt;br /&gt;
print &amp;quot;--------&amp;quot;&lt;br /&gt;
print &amp;quot;Temperature: ${avetemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errtemp}&amp;quot;&lt;br /&gt;
print &amp;quot;Pressure: ${avepress}&amp;quot;&lt;br /&gt;
print &amp;quot;Stderr: ${errpress}&amp;quot;&lt;br /&gt;
print &amp;quot;heatcapacity: ${heatcapacity}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695989</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695989"/>
		<updated>2018-03-28T10:45:23Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We enclose the atoms created in a cubic simulation &amp;quot;box&amp;quot; with fixed dimensions, and set the lattice type of the melting crystal and density of lattice unit. This can be related to realistic systems when applying this to e.g. water system:&lt;br /&gt;
&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble(&amp;lt;u&amp;gt;&#039;&#039;modified nvt.in is attached as appendix&#039;&#039;&amp;lt;/u&amp;gt;). Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states. The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order. The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:liquid222.png|250px|thumb|left|3375 atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:vapour222.png|250px|thumb|left|3375 atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:solid222.png|250px|thumb|left|3375 atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:1mmmliquid.png|250px|thumb|left|1 million atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:1mmmvapour.png|250px|thumb|left|1 million atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:1mmmsolid.png|250px|thumb|left|1 million atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid simulation corresponded to a real liquid as MSD increased linearly with simulation time as the atoms moved in Brownian motion. The vapour simulation was also linear for the most part as it also resembles a brownian motion. The first curve bit raised from the random collision of vapour atoms as they were very far apart and the probability, or frequency,  of collisions would be quite small. Thus needed some time to establish this statical equilibrium. For solid phase, atoms only move around a fixed position and the MSD reached constant average value at around 200 tilmestep. The simulation illustrated these information satisfyingly. By comparing 3375 atom system to 1 million atom system, clearly the 1 million system gave better stable results as there were more atoms and more collisions could be sampled and data would meet statistical requirement better.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695988</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695988"/>
		<updated>2018-03-28T10:38:12Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states.[3]:&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:liquid222.png|250px|thumb|left|3375 atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:vapour222.png|250px|thumb|left|3375 atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:solid222.png|250px|thumb|left|3375 atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:1mmmliquid.png|250px|thumb|left|1 million atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:1mmmvapour.png|250px|thumb|left|1 million atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:1mmmsolid.png|250px|thumb|left|1 million atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The liquid simulation corresponded to a real liquid as MSD increased linearly with simulation time as the atoms moved in Brownian motion. The vapour simulation was also linear for the most part as it also resembles a brownian motion. The first curve bit raised from the random collision of vapour atoms as they were very far apart and the probability, or frequency,  of collisions would be quite small. Thus needed some time to establish this statical equilibrium. For solid phase, atoms only move around a fixed position and the MSD reached constant average value at around 200 tilmestep. The simulation illustrated these information satisfyingly. By comparing 3375 atom system to 1 million atom system, clearly the 1 million system gave better stable results as there were more atoms and more collisions could be sampled and data would meet statistical requirement better.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695984</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695984"/>
		<updated>2018-03-28T10:29:30Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states.[3]:&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:liquid222.png|300px|thumb|left|3375 atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:vapour222.png|300px|thumb|left|3375 atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:solid222.png|300px|thumb|left|3375 atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:1mmmliquid.png|450px|thumb|left|1 million atoms Liquid simulation at d=0.8, T=1.2]]&lt;br /&gt;
||[[File:1mmmvapour.png|450px|thumb|left|1 million atoms Vapour simulation at d=0.1, T=1.2]]&lt;br /&gt;
||[[File:1mmmsolid.png|450px|thumb|left|1 million atoms Solid simulation at d=1.6, T=1.2]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmvapour.png&amp;diff=695981</id>
		<title>File:1mmmvapour.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmvapour.png&amp;diff=695981"/>
		<updated>2018-03-28T10:24:53Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmsolid.png&amp;diff=695980</id>
		<title>File:1mmmsolid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmsolid.png&amp;diff=695980"/>
		<updated>2018-03-28T10:24:37Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmliquid.png&amp;diff=695979</id>
		<title>File:1mmmliquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1mmmliquid.png&amp;diff=695979"/>
		<updated>2018-03-28T10:24:21Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid222.png&amp;diff=695978</id>
		<title>File:Solid222.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid222.png&amp;diff=695978"/>
		<updated>2018-03-28T10:23:59Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour222.png&amp;diff=695977</id>
		<title>File:Vapour222.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour222.png&amp;diff=695977"/>
		<updated>2018-03-28T10:23:33Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid222.png&amp;diff=695976</id>
		<title>File:Liquid222.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid222.png&amp;diff=695976"/>
		<updated>2018-03-28T10:23:16Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695965</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695965"/>
		<updated>2018-03-28T10:10:42Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, so by substitution:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity. This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity. The reason could be high density meant the particles would be closer together in a  lower volume and energy transfer between atoms would be faster, therefore less heat is required to heat the system. For the same number of particles with lower density, atoms would be further apart and would need more energy to heat up.&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]&lt;br /&gt;
&lt;br /&gt;
The radial distribution function was plotted for vapour, liquid and solid phases. The densities and temperatures were chosen from Lennard-Jones phase diagram to fulfil the system states.[3]:&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle and would reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695952</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695952"/>
		<updated>2018-03-28T10:01:23Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.[3]:&lt;br /&gt;
Phase	Density	Temperature&lt;br /&gt;
Vapour	0.1	1.2&lt;br /&gt;
Liquid	0.8	1.2&lt;br /&gt;
Solid	1.6	1.2&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695949</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695949"/>
		<updated>2018-03-28T10:00:12Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Single-specied system was generated as it would be simpler to only consider interaction between same kind of atoms. Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&lt;br /&gt;
Starting from Ideal Gas Law equation &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; and reduced unit equations from &#039;&#039;Introduction&#039;&#039;,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The results showed that the simulated densities were much lower than the IGL densities however same decreasing trend was observed against temperature. This is because the Ideal Gas Law assumes that there is no interaction between molecules and the repulsive force between the molecules is zero. Molecules in Ideal Gas system can be compressed to a great extent, making the volume occupied very small for a given volume. Therefore the density can be higher. In the Lennard-Jones model, the molecules will interact with each other when they come too close to each other and the repulsive force arises with decreasing distance. Therefore for a given volume the molecules will rather stay far apart and the density would be lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The discrepancy also increases with pressure. At lower pressures, the intermolecular distance is large and densities do not change as much percentage as at high pressures.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.[3]:&lt;br /&gt;
Phase	Density	Temperature&lt;br /&gt;
Vapour	0.1	1.2&lt;br /&gt;
Liquid	0.8	1.2&lt;br /&gt;
Solid	1.6	1.2&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695944</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695944"/>
		<updated>2018-03-28T09:47:04Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero,&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
Density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.[3]:&lt;br /&gt;
Phase	Density	Temperature&lt;br /&gt;
Vapour	0.1	1.2&lt;br /&gt;
Liquid	0.8	1.2&lt;br /&gt;
Solid	1.6	1.2&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695941</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695941"/>
		<updated>2018-03-28T09:40:58Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Abstract */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
This experiment used computational method to simulate a simple liquid model using Lennard-Jones potential and velocity-Verlet algorithm. A number of observables were output and compared to realistic liquids to justify  the accuracy of the model system generated by this method.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can also be expressed in standard 12/6 form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth, &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
Force is the negative derivative of potential energy. When the equation of force in terms of the Lennard-Jones potential is zero, the equilibrium is reached and the resultant force is also zero:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.[3]:&lt;br /&gt;
Phase	Density	Temperature&lt;br /&gt;
Vapour	0.1	1.2&lt;br /&gt;
Liquid	0.8	1.2&lt;br /&gt;
Solid	1.6	1.2&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid.png&amp;diff=695933</id>
		<title>File:Solid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Solid.png&amp;diff=695933"/>
		<updated>2018-03-28T09:30:39Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Zc2814 uploaded a new version of File:Solid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid.png&amp;diff=695931</id>
		<title>File:Liquid.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Liquid.png&amp;diff=695931"/>
		<updated>2018-03-28T09:28:53Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Zc2814 uploaded a new version of File:Liquid.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour.png&amp;diff=695930</id>
		<title>File:Vapour.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Vapour.png&amp;diff=695930"/>
		<updated>2018-03-28T09:28:25Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDFSOL.png&amp;diff=695922</id>
		<title>File:RDFSOL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDFSOL.png&amp;diff=695922"/>
		<updated>2018-03-28T09:15:56Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695918</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695918"/>
		<updated>2018-03-28T09:08:41Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|Heat capacity/V vs temperature at density=0.2 and density=0.8]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:RDF.png|700x400px|thumb|left|g(r) vs r for solid, liquid and vapour]]The radial distribution function was plotted for vapour, liquid and solid phases(Fig.9). The densities and temperatures were chosen from the phase diagram for the Lennard-Jones diagram.[3]:&lt;br /&gt;
Phase	Density	Temperature&lt;br /&gt;
Vapour	0.1	1.2&lt;br /&gt;
Liquid	0.8	1.2&lt;br /&gt;
Solid	1.6	1.2&lt;br /&gt;
The radial distribution function indicates the probability of finding a nearest neighbor from a particle. It will reveal the phase of the system simulated. The RDFs for the three systems are very different. The solid has the largest number of peaks followed by liquid and then gas. The peaks represent the density around each atom and hence solid which has the highest density will have more peaks. The peaks in the solid phase has decreasing amplitude with increasing r. It can be seen that the probability of finding a particle between the first and second peak is zero. This is because particles in solid phase do not have brownian motion and can only vibrate in fixed positions. The solid phase has long and short range order and this can be indicated by the peaks. The short range order is shown by the first three tall peaks and the long range order is shown by the smaller peaks behind.&lt;br /&gt;
The RDF of the liquid phase has three peaks with decreasing amplitude as r increases. The wider peaks mean that the liquid phase is more disordered than the solid phase.The decreasing amplitude with increasing interatomic separation indicates that the Brownian motion of particles in the liquid phase makes the order decrease with increasing separation. The three peaks indicate that the liquid phase only has short range order.&lt;br /&gt;
The RDF of the gas phase only has one broad peak. This suggests the gas phase is highly disordered and there is no short nor long range order.&lt;br /&gt;
In the RDF of the solid phase, the first three peaks correspond to the nearest neighbor of the referenced particle, the second nearest particle and the third nearest particle respectively. The lattice spacing is the distance between the zero probability minima and is 1.275 in reduced units.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695915</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695915"/>
		<updated>2018-03-28T09:04:16Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.This is because the lattice energy gap decreases with increasing temperature, so less energy will be required. This indicates that heat capacity is proportional to energy as shown in the equation. Also, it is shown that the lower the density, the lower the heat capacity.This is because high density means the particles will be closer together with lower volume, therefore less heat is required to heat the system. For the same number of particles, if the density is lower, that means the volume the particles take up is larger. Therefore the heat required is higher .&lt;br /&gt;
&lt;br /&gt;
[[File:heatcapa.png|700x400px|thumb|center|]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heatcapa.png&amp;diff=695913</id>
		<title>File:Heatcapa.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heatcapa.png&amp;diff=695913"/>
		<updated>2018-03-28T09:02:10Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDF.png&amp;diff=695911</id>
		<title>File:RDF.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:RDF.png&amp;diff=695911"/>
		<updated>2018-03-28T09:01:22Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: Zc2814 uploaded a new version of File:RDF.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695910</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695910"/>
		<updated>2018-03-28T08:58:31Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T} = \frac{\mathrm{Var}\left[E\right]}{k_B T^2} = N^2\frac{\left\langle E^2\right\rangle - \left\langle E\right\rangle^2}{k_B T^2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\mathrm{Var}\left[E\right]&amp;lt;/math&amp;gt; is the variance in &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, &amp;lt;math&amp;gt;N&amp;lt;/math&amp;gt; is the number of atoms, and it is a standard result from statistics that &amp;lt;math&amp;gt;\mathrm{Var}\left[X\right] = \left\langle X^2\right\rangle - \left\langle X\right\rangle^2&amp;lt;/math&amp;gt;. The &amp;lt;math&amp;gt;N^2&amp;lt;/math&amp;gt; is required because LAMMPS divides all energy output by the number of particles (so when you measure &amp;lt;math&amp;gt;E&amp;lt;/math&amp;gt;, you are actually measuring &amp;lt;math&amp;gt;E/N&amp;lt;/math&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695909</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695909"/>
		<updated>2018-03-28T08:57:12Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, volume and temperature constant were simulated in the NVT ensemble session. Heat capacity calculation was put into the input script:&lt;br /&gt;
&lt;br /&gt;
Heat capacity can be understood as how far the system is able to fluctuate from its average equilibrium temperature, as well as total energy. As the results shown above, smaller time step would lead to smaller fluctuation therefor stable system and very large heat capacity.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695907</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695907"/>
		<updated>2018-03-28T08:50:06Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law from method below for comparison:&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt; through the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\frac{N}{V^*}=N\frac{\sigma ^3}{V}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;\frac{N}{V}=\frac{P}{k_BT}&amp;lt;/math&amp;gt;,&amp;lt;math&amp;gt;P=P^*\frac{\varepsilon}{\sigma ^3}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;T=T^*\frac{\varepsilon}{K_B}&amp;lt;/math&amp;gt;&amp;lt;ref&amp;gt;&amp;lt;nowiki&amp;gt;http://www4.ncsu.edu/~franzen/public_html/CH795N/modules/ar_mod/comp_output.html&amp;lt;/nowiki&amp;gt;&amp;lt;/ref&amp;gt;, by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\rho^*=\sigma ^3 \frac{P}{k_BT}=\sigma ^3 \frac{P^*\frac{\varepsilon}{\sigma ^3}}{k_BT^*\frac{\varepsilon}{K_B}}=\frac{P^*}{T^*}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695906</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695906"/>
		<updated>2018-03-28T08:48:13Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
[[File:densityvstemp.png|450px|thumb|center|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
[[File:IGL.png|450px|thumb|center|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695904</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695904"/>
		<updated>2018-03-28T08:42:44Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align: center&lt;br /&gt;
|[[File:densityvstemp.PNG|450px|thumb|left|Density vs Temperature simulated at pressure=2.3 and pressure=2.6]]&lt;br /&gt;
|[[File:IGL.PNG|450px|thumb|left|Comparison of Density calculated by Ideal Gas Law and simulated LJ model at P=2.3 and P=2.6]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:IGL.png&amp;diff=695901</id>
		<title>File:IGL.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:IGL.png&amp;diff=695901"/>
		<updated>2018-03-28T08:40:39Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Densityvstemp.png&amp;diff=695900</id>
		<title>File:Densityvstemp.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Densityvstemp.png&amp;diff=695900"/>
		<updated>2018-03-28T08:40:20Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695899</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695899"/>
		<updated>2018-03-28T08:39:11Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison. This is because the Ideal Gas Law assumes that the molecules do not interact with each other and the repulsive force between the molecules is zero.This means that the particles in Ideal Gas system can be compressed to great extent, making the volume occupied very small for a given volume. Therefore the density is higher. In the Lennard-Jones model, the molecules will interact with each other and the repulsive force is greater when the distance between the molecules is smaller. Therefore for a given volume the molecules will rather stay far apart and the density is lower .&lt;br /&gt;
&lt;br /&gt;
It can be seen from Fig.7 that the discrepancy increases with pressure. This is because at lower pressure, provided that the volume is large enough, the intermolecular distance is larger and the density will not change a lot by the distance between the particles.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695889</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695889"/>
		<updated>2018-03-28T08:25:18Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the system with N atoms, each with 3 degrees of freedom:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;E_K = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T (1)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By multiplying every velocity by &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; and substituting T with &amp;lt;math&amp;gt;\mathfrak{T}&amp;lt;/math&amp;gt; we can get the second equation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (\gamma v_i)^2 = \frac{3}{2} N k_B \mathfrak{T} (2)&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i (v_i)^2 \times \gamma^2  = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By substituting (2) we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{3}{2} N k_B T \times \gamma^2 =\frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\gamma^2 = \frac{\mathfrak{T}}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \gamma= \sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695888</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695888"/>
		<updated>2018-03-28T08:24:14Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled to satisfy target temperature &amp;lt;math&amp;gt; \mathfrak{T} &amp;lt;/math&amp;gt;by adjusting &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; so that the temperature was correct &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt; if every velocity was multiplied by this constant&amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695887</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695887"/>
		<updated>2018-03-28T08:20:57Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
System kept number of atoms, pressure and temperature constant were simulated in the NpT ensemble session. During the simulation, temperature was controlled by adjusting&lt;br /&gt;
&lt;br /&gt;
Densities were calculated by  and this was plotted as a function of temperature. Densities corresponded to certain temperature and pressure were also calculated form Ideal Gas Law for comparison. &lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695883</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695883"/>
		<updated>2018-03-28T08:13:33Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. From the results, 0.0025 and 0.001 would be suitable. However, even the 0.001 timestep task here took less than 10 minutes to simulate, so 0.001 was chosen for further simulations for more detailed and accurate results. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695882</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695882"/>
		<updated>2018-03-28T08:08:13Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
### SPECIFY TIMESTEP ###&lt;br /&gt;
variable timestep equal 0.001&lt;br /&gt;
variable n_steps equal floor(100/${timestep})&lt;br /&gt;
timestep ${timestep}&lt;br /&gt;
&lt;br /&gt;
### RUN SIMULATION ###&lt;br /&gt;
run ${n_steps}&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Timestep set up was written as above, instead of:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
timestep 0.001&lt;br /&gt;
run 100000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This was to define a variable &amp;quot;timestep&amp;quot; so the numerical timestep did not need to be changed manually when it needed to be changed and more than one tilmestep can be run in sequence in a single script if wanted.&lt;br /&gt;
Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame temperatures, pressures and total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695881</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695881"/>
		<updated>2018-03-28T08:03:20Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame temperatures, pressures and total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. &lt;br /&gt;
[[File:totE.png|600x600px|thumb|centre|Timestep 0.015 was particularly bad as it never reached equilibrium. 0.01 and 0.0075 reached equilibrium but averaged total energies were higher than the ones from 0.0025 and 0.001]]&lt;br /&gt;
&lt;br /&gt;
Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:TotE.png&amp;diff=695879</id>
		<title>File:TotE.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:TotE.png&amp;diff=695879"/>
		<updated>2018-03-28T07:57:45Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695877</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695877"/>
		<updated>2018-03-28T07:46:46Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
[[File:vvsimvsclaharosc.png|600x600px|thumb|centre|position by classic harmonic oscillator vs. position by velocity-Verlet algorithm]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxerror.png|600x600px|thumb|centre|Error vs Time]]&lt;br /&gt;
&lt;br /&gt;
[[File:1%of0.1.png|600x600px|thumb|center|Energy vs. Time at 0.1 timestep]]&lt;br /&gt;
[[File:1%of0.2.png|400x400px|thumb|center|Energy vs. Time at 0.2 timestep]][[File:1%of0.3.png|400x400px|thumb|center|Energy vs. Time at 0.3 timestep]]&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame temperatures, pressures and total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695865</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695865"/>
		<updated>2018-03-28T07:36:51Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, 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;.When LJ cutoff is&amp;lt;math&amp;gt; r^* =3.2&amp;lt;/math&amp;gt;, in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt; in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame temperatures, pressures and total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695864</id>
		<title>Rep:Mod:ZC2814liqsim</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:Mod:ZC2814liqsim&amp;diff=695864"/>
		<updated>2018-03-28T07:32:08Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: /* Results and Discussion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&#039;&#039;&#039;Velocity-Verlet algorithm&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Velocity-Verlet is one modified edition of Verlet&#039;s algorithm with approximations and good precision. We wanted to simulate a real liquid system from knowing the starting positions of atoms and their velocities at the same time, so velocity-varlet algorithm was used.  Firstly we set up a collection of N atoms which behave as classical particles and each one of them interacted with every atom else in the system. So every atom felt a force. As in Newton&#039;s second law F=am and its differential equations, if we know how the force, F, changes with respect to time, we can know the position and velocity of an atom in the system at any time by solving the equation relating to that atom.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=m_ia_i=m_i\frac{dv_i}{dt}=m_i\frac{d^2x_i}{dt^2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{F}_i&amp;lt;/math&amp;gt; is the force acting on atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;m_i&amp;lt;/math&amp;gt; is the mass of atom i.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{a}_i(t)&amp;lt;/math&amp;gt; is the acceleration of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{v}_i(t)&amp;lt;/math&amp;gt; is the velocity of atom i at time t.&lt;br /&gt;
* &amp;lt;math&amp;gt;\mathbf{x}_i(t)&amp;lt;/math&amp;gt; is the position of atom i at time t.&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;Instead of solving with positions, velocities and forces as continuous functions with respect to time, they can be break up into changes with a sequence of timesteps with length &amp;lt;math&amp;gt;\delta t&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;. By adding up the Taylor expansions of the positions for a single atom at its next tilmestep and one timestep backwards followed by substitution of Newton&#039;s second law, we arrive at: &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;x_i(t+\delta t)=2x_i(t)-x_i(t-\delta t)+\frac{F_i(t)}{m_i}\delta t^2&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;The Newton&#039;s law for these atoms can be solved by Verlet&#039;s algorithm, however, this methods does not output velocities therefore we cannot calculate kinetic energies. Velocity-Varlet algorithm comes up to get around this problem. We assume that the acceleration of an atom only  depends on its position. W can now calculate atomic velocities explicitly. Velocity-Verlet algorithm has its form with an accuracy up to &amp;lt;math&amp;gt;\delta t^2&amp;lt;/math&amp;gt;&amp;lt;nowiki&amp;gt;: &amp;lt;/nowiki&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;v_i(t +\delta t)=v_i(t+\frac{1}{2}\delta t)+\frac{1}{2}a_i(t+ \delta t)\delta t&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Atomic Forces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt; &amp;lt;/nowiki&amp;gt;As we were simulating a simple liquid with only one type of atom, Lennard-Jones potential would be able to model the interactions between atom pairs.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;U\left(\mathbf{r}^N\right) = \sum_i^N \sum_{i \neq j}^{N} \left\{ 4\epsilon \left( \frac{\sigma^{12}}{r_{ij}^{12}} - \frac{\sigma^6}{r_{ij}^6} \right) \right\} &amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Lennard-Jones potential can tell the potential energy of the interaction between two uncharged atoms. It can be expressed in (12,6) form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r)=4\varepsilon(\frac{\sigma^{12}}{r^{12}}-\frac{\sigma^6}{r^6})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this equation,&amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; is the potential well depth,&amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; is the distance where the potential between the pair of particles is zero and r is the distance between the pair of particles.&lt;br /&gt;
&lt;br /&gt;
As force is the negative derivative of potential energy, the equation of force in terms of the Lennard-Jones potential is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F_i=-\frac{d\phi (r^N)}{dr_i}&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;24\varepsilon[2(\frac{\sigma^{12}}{r_i ^{13}})-\frac{\sigma^6}{r_i ^7}]&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the potential energy is zero, &amp;lt;math&amp;gt;r_i=\sigma=r_0&amp;lt;/math&amp;gt;, therefore by substitution we can get:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{r_0 ^{12}}{r_0 ^{13}})-\frac{r_0^6}{r_0 ^7}]=24\varepsilon[\frac{2}{r_0}-\frac{1}{r_0}]=\frac{24\varepsilon}{r_0}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The equilibrium is reached when the resultant force is zero, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;F=24\varepsilon[2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}]=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2(\frac{\sigma^{12}}{r^{13}})-\frac{\sigma^6}{r^7}=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Divide both sides by &amp;lt;math&amp;gt;\frac{\sigma^6}{r^7}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;2\frac{\sigma^6}{r^6}-1=0&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, the equilibrium separation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;r_{eq} =\sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The LJpotential at &amp;lt;math&amp;gt;r_{eq}&amp;lt;/math&amp;gt; is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\phi(r_{eq})=4\varepsilon(\frac{\sigma^{12}}{4\sigma^{12}}-\frac{\sigma^6}{2\sigma^6})=4\varepsilon(-\frac{1}{4})=-\varepsilon&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\varepsilon=-\phi(r_{eq})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}\varepsilon \sigma^{12}r^{-11}+\frac{4}{5}\varepsilon \sigma^{6}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\sigma=\varepsilon=1.0&amp;lt;/math&amp;gt;, therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt; \int\phi\left(r\right)\mathrm{d}r=-\frac{4}{11}r^{-11}+\frac{4}{5}r^{-5}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2^{11}}-\frac{4}{5}\times\frac{1}{2^5}=-2.48\times 10^{-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{2.5^{11}}-\frac{4}{5}\times\frac{1}{2.5^5}=-8.18\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r=\frac{4}{11}\times\frac{1}{3^{11}}-\frac{4}{5}\times\frac{1}{3^5}=-3.29\times 10^{-3}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Periodic Boundary Conditions and&#039;&#039;&#039; &#039;&#039;&#039;Truncation&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;math&amp;gt;1 mL=1 cm^3&amp;lt;/math&amp;gt;. The density of water=&amp;lt;math&amp;gt;1 g/cm^3&amp;lt;/math&amp;gt; under standard consitions (298K, 1atm). So the total mass of 1 mL water= 1g. The number of moles of water molecules=&amp;lt;math&amp;gt;\frac{1}{M_{H_2 O}}=\frac{1g}{18g/mol}=0.056 moles&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore the total number of molecules in 1 mL of water=&amp;lt;math&amp;gt;n\times N_a =0.056\times 6.02\times 10^{23}=3.37\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume of 10,000 molecules of water=&amp;lt;math&amp;gt;\frac{10000}{3.37\times 10^{22}}=2.97\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The initial position of atom is &amp;lt;math&amp;gt;(0.5,0.5,0.5)&amp;lt;/math&amp;gt;. After it moves along the vector &amp;lt;math&amp;gt;(0.7,0.6,0.2)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(1.2,1.1,0.7)&amp;lt;/math&amp;gt;. Applying the periodic boundary of &amp;lt;math&amp;gt;(0,0,0)&amp;lt;/math&amp;gt; to &amp;lt;math&amp;gt;(1,1,1)&amp;lt;/math&amp;gt;, the position should be &amp;lt;math&amp;gt;(0.2,0.1,0.7)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reduced Units&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;  &amp;lt;/nowiki&amp;gt;Reduced units were used throughout the experiment as Lennard-Jones interactions were used. &lt;br /&gt;
* distance &amp;lt;math&amp;gt;r^* = \frac{r}{\sigma}&amp;lt;/math&amp;gt;&lt;br /&gt;
* energy &amp;lt;math&amp;gt;E^* = \frac{E}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
* temperature &amp;lt;math&amp;gt;T^* = \frac{k_BT}{\epsilon}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, the Lennard-Jones parameters for argon are . When LJ cutoff is , in real units it will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;r=r^*\sigma =0.34\times 10^{-9}\times 3.2=1.09nm&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth in kJ/mol will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\varepsilon=120K\times K_B \times 10^{-3} \times 6.022\times 10^{23}=0.997 KJ/mol&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And the reduced temperature in real units will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;T^*=1.5&amp;lt;/math&amp;gt;, therefore &amp;lt;math&amp;gt;T=T^*\times \frac{\varepsilon}{K_B}=1.5\times 120K=180K&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Aims and Objectives ==&lt;br /&gt;
We aimed to simulate a single-specied liquid system by melting a crystal which closely represents a real liquid system. As we were starting from assigning every atom its initial position and initial velocity, velocity-Verlet  algorithm was used for simulation. Pressure changes and density changes as a function of temperature was output and compared with real systems at NpT and NVT ensembles respectively. The simulation would then be extended to vapour and solid, to see if any differences between realistic gas, liquid and solid phases could be observed.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&#039;&#039;&#039;TIME STEP&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Melt_crystal.in was used as template and run at timesteps 0.001, 0.0025, 0.0075, 0.01 and 0.015 repectively by LAMMPS on HPC. Output log files were saved as .txt and trajectory files saved as .lammptrj.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NpT ensemble&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Simple cubic lattice crystal generated with density 0.8. Cubic simulation box “box” extending 10 lattice spacings from origin in x, y and z directions containing only one type(type 1) of atoms was generated. Mass of type 1 atoms was set at 1.0. Interaction set at pairwise standard 12/6 Lennard-Jones potential without Coulombic interaction, with a cutoff distance 3.0 with lines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_style lj/cut 3.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pairwise force field between any pair of atoms was set at 1.0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;pair_coeff  * * 1.0 1.0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Initial velocities were assigned to every atom created at temperature “variable T” fulfilling Maxwell-Boltzmann distribution. How much time simulated so far, total energy of the atoms, temperature and pressure were output by LAMMPS every 10th timestep. Timestep was set at 0.001, total timestep equaled 100000 which meant 100 time units was simulated. Temperature chosen to run were 2.0, 2.2, 2.4, 2.6, 2.8 simulated at pressure 2.6 or 5.0 respectively. Values of density, pressure and temperature would be sampled every 100 timesteps for an average value. 1000 values were sampled for every variables listed above over 100000 timesteps. These ten &#039;&#039;.in&#039;&#039; files were run by LAMMPS on HPC and output log files were saved.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NVT ensembles&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
npt.in was taken to be modified into NVT ensemble. Equilibrium was generated by melting a crystal and all npt in script changed by nvt. Thermostat was turned off once the system was in correct thermodynamic state. 0.001 timestep was used to run 100000 timesteps. Average temperature calculated from values of every 100 timesteps and heat capacity was output by LAMMPS at input temperature 2.0, 2.2, 2.4, 2.6 and 2.8 for density 0.2 or 0.8 respectively, 10 simulations in total. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;RDF&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq.in&#039;&#039; at density=0.8, temperature=1.2 was used as a template for running &#039;&#039;vap.in&#039;&#039; and &#039;&#039;sol.in&#039;&#039;. for vapour and solid systems. &#039;&#039;vap.in&#039;&#039; had density=0.4, temperature=1.2 while &#039;&#039;sol.in&#039;&#039; had density=1.6, temperature=1.2 and lattice type fcc instead of sc. 3 systems were run by LAMMPS on HPC. g(r) and intergration of g(r) with respect to r were calculated by VMD using output trajectory files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MSD&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;liq(2).in&#039;&#039; with density=0.8 and temperature=1.2 was used as template for running &#039;&#039;vap(2).in&#039;&#039; and &#039;&#039;sol(2).in&#039;&#039;. The two input files were modified by same steps as RDF. 3 systems were run by LAMMPS on HPC. MSD files and VACF files were saved.&lt;br /&gt;
&lt;br /&gt;
== Results and Discussion ==&lt;br /&gt;
Velocity-Verlet algorithm was used to approximately solve LJ potential mode at tilmestep 0.1, 0.2 and 0.3. The results were compared with calculations from classic harmonic oscillator. Errors accumulated with increasing time so simulations of long periods was discouraged. Examining equilibrium with small time steps and short real time showed that equilibrium could be achieved very shortly after the simulation started. Therefore short time period would be encouraged. From these results, only timestep smaller than 0.2 could achieve total energy changes less than 1%.&lt;br /&gt;
&lt;br /&gt;
Smaller different timesteps(0.001, 0.0025, 0.0075, 0.01, 0.015) were examined as to determine a suitable timestep for further simulations and outcame temperatures, pressures and total energies were under comparison. Monitoring total energy numerically was important as we needed to make sure our simulated system fulfilled energy conservation, correctly modelling real systems. Simulation boxes were created with commands to enclosure the atoms. The system was not started from assigning random positions to every atom, but started from melting a crystal structure as two atoms may be generated too close to each other or might even collide. We were running the simulation under Lennard-Jones interaction, so repulsive force and potential energy would shoot up and unstabilize the system. Further more, crystal structures were highly ordered and it would be quite easy to assign positions to atoms once one atom was assigned. This was made even easier by creating simple cubic lattice with dimension 10 in x, y and z from origin instead of other ones. The side length of the simulated box was 1.07722 in the output file. If a face-centred cubic lattice with a lattice point number density of 1.2 was simulated, the side length of the cubic unit cell would be&amp;lt;math&amp;gt; \sqrt[3]{\frac{4}{1.2}}= 1.49&amp;lt;/math&amp;gt; and 4000 atoms would be created.&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
----&lt;br /&gt;
== Appendix &amp;amp; References ==&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.3.png&amp;diff=695859</id>
		<title>File:1%of0.3.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.3.png&amp;diff=695859"/>
		<updated>2018-03-28T07:16:25Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.2.png&amp;diff=695858</id>
		<title>File:1%of0.2.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.2.png&amp;diff=695858"/>
		<updated>2018-03-28T07:16:03Z</updated>

		<summary type="html">&lt;p&gt;Zc2814: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Zc2814</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.1.png&amp;diff=695857</id>
		<title>File:1%of0.1.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:1%25of0.1.png&amp;diff=695857"/>
		<updated>2018-03-28T07:15:39Z</updated>

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