<?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=Sz3614</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=Sz3614"/>
	<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/wiki/Special:Contributions/Sz3614"/>
	<updated>2026-07-11T19:11:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563214</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563214"/>
		<updated>2016-11-04T10:08:35Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every 100 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 is the Nrepeat = 1000 of times to use input values to calculate averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10000 is the Nfreq = calculate averages every 10000 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumes no intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely due to the repulsion. Also, significant peaks indicate that atoms packed close to each other. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are at fixed lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent very damped oscillations. The oscillation is a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are stil close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are a fixed positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563208</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563208"/>
		<updated>2016-11-04T10:05:04Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every 100 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 is the Nrepeat = 1000 of times to use input values to calculate averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10000 is the Nfreq = calculate averages every 10000 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumes no intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent very damped oscillations. The oscillation is a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are stil close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are a fixed positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563206</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563206"/>
		<updated>2016-11-04T10:04:28Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every 100 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 is the Nrepeat = 1000 of times to use input values to calculate averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10000 is the Nfreq = calculate averages every 10000 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumes no intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system represent very damped oscillations. The oscillation is a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are stil close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are a fixed positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563204</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563204"/>
		<updated>2016-11-04T10:00:16Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every 100 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 is the Nrepeat = 1000 of times to use input values to calculate averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10000 is the Nfreq = calculate averages every 10000 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumes no intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563203</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563203"/>
		<updated>2016-11-04T09:59:22Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every 100 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
1000 is the Nrepeat = 1000 of times to use input values to calculate averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
10000 is the Nfreq = calculate averages every 10000 timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563202</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563202"/>
		<updated>2016-11-04T09:56:33Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument. According to the L-J potential graph, cut-off value usually at a distance of 2.5.&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563201</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563201"/>
		<updated>2016-11-04T09:54:45Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer because of the attraction, they lose potential energy which is lost as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot simulate a system with the infinite potential because the atoms are going to blow up with the infinite potential.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563194</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563194"/>
		<updated>2016-11-04T09:50:13Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563193</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563193"/>
		<updated>2016-11-04T09:49:38Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt;equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;^{\left ( 1 \right )}, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563190</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563190"/>
		<updated>2016-11-04T09:48:32Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 12 \right )}&amp;lt;/math&amp;gt; Revision Maths, https://revisionmaths.com/advanced-level-maths-revision/pure-maths/calculus/trapezium-rule, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563186</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563186"/>
		<updated>2016-11-04T09:47:29Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563182</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563182"/>
		<updated>2016-11-04T09:46:15Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563180</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563180"/>
		<updated>2016-11-04T09:45:18Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563174</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563174"/>
		<updated>2016-11-04T09:43:53Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563172</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563172"/>
		<updated>2016-11-04T09:42:01Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563169</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563169"/>
		<updated>2016-11-04T09:41:18Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563167</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563167"/>
		<updated>2016-11-04T09:40:58Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;/math&amp;gt;   &amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563166</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563166"/>
		<updated>2016-11-04T09:40:32Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563164</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563164"/>
		<updated>2016-11-04T09:40:11Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563163</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563163"/>
		<updated>2016-11-04T09:39:17Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563162</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563162"/>
		<updated>2016-11-04T09:38:25Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt; Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt; Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt; Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 5 \right )}&amp;lt;/math&amp;gt; University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 6 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 7 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 8 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 9 \right )}&amp;lt;/math&amp;gt; Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt; Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;^{\left ( 11 \right )}&amp;lt;/math&amp;gt; Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563161</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563161"/>
		<updated>2016-11-04T09:37:07Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563158</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563158"/>
		<updated>2016-11-04T09:35:54Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563156</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563156"/>
		<updated>2016-11-04T09:35:34Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&amp;lt;math&amp;gt;^{\left ( 1 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563155</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563155"/>
		<updated>2016-11-04T09:34:50Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0 &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types &amp;lt;math&amp;gt;^{\left ( 4 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563154</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563154"/>
		<updated>2016-11-04T09:33:59Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563153</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563153"/>
		<updated>2016-11-04T09:33:41Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. &amp;lt;math&amp;gt;^{\left ( 3 \right )}&amp;lt;/math&amp;gt; The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563150</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563150"/>
		<updated>2016-11-04T09:32:45Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&amp;lt;math&amp;gt;^{\left ( 10 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563149</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563149"/>
		<updated>2016-11-04T09:31:51Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left ( 2 \right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563148</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563148"/>
		<updated>2016-11-04T09:30:34Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (1\right )}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;&amp;lt;math&amp;gt;^{\left (  3\right )}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563139</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563139"/>
		<updated>2016-11-04T09:26:04Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563136</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563136"/>
		<updated>2016-11-04T09:25:38Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
10. Faculty of Physcis, http://phys.ubbcluj.ro/~tbeu/MD/C2_for.pdf, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
11. Jean-Pierre Hansen and Loup Verlet, Phys. Rev., 1969, 184, 151&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563125</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=563125"/>
		<updated>2016-11-04T09:15:54Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
*Online resources&lt;br /&gt;
1. Chemistry Wiki, https://wiki.ch.ic.ac.uk/wiki/index.php?title=Third_year_simulation_experiment, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
2. Chemistry libretexts, http://chem.libretexts.org/Core/Physical_and_Theoretical_Chemistry/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Intermolecular_Forces/Specific_Interactions/Lennard-Jones_Potential, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
3. The physics classroom, http://www.physicsclassroom.com/calcpad/energy, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
4. Lammps, http://lammps.sandia.gov/doc/Section_commands.html#cmd_5, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
5. University of Oregan, http://abyss.uoregon.edu/~js/glossary/ideal_gas_law.html, (accessed October 2016).&lt;br /&gt;
&lt;br /&gt;
6. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/rdf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
7. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
8. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/msd2.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
9. Democritus, http://www.ccp5.ac.uk/DL_POLY/Democritus/Theory/vaf.html, (accessed November 2016).&lt;br /&gt;
&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562802</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562802"/>
		<updated>2016-11-03T22:05:38Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs with data obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562801</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562801"/>
		<updated>2016-11-03T22:05:07Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
Some other graphs obtained&lt;br /&gt;
&lt;br /&gt;
[[File:When timestep=0.12 OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Maxima error vs time OH.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Heat capacityV vs temperatutre with data.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Rdf and integral of rdf summary graph.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacityV_vs_temperatutre_with_data.png&amp;diff=562800</id>
		<title>File:Heat capacityV vs temperatutre with data.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Heat_capacityV_vs_temperatutre_with_data.png&amp;diff=562800"/>
		<updated>2016-11-03T22:04:45Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Maxima_error_vs_time_OH.png&amp;diff=562796</id>
		<title>File:Maxima error vs time OH.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Maxima_error_vs_time_OH.png&amp;diff=562796"/>
		<updated>2016-11-03T22:03:46Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:When_timestep%3D0.12_OH.png&amp;diff=562794</id>
		<title>File:When timestep=0.12 OH.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:When_timestep%3D0.12_OH.png&amp;diff=562794"/>
		<updated>2016-11-03T22:02:58Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rdf_and_integral_of_rdf_summary_graph.png&amp;diff=562793</id>
		<title>File:Rdf and integral of rdf summary graph.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Rdf_and_integral_of_rdf_summary_graph.png&amp;diff=562793"/>
		<updated>2016-11-03T22:02:07Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562761</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562761"/>
		<updated>2016-11-03T21:41:28Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is 0.068294227 in solid, 135.1372144 in liquid and 4902.698697in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.022764742, in liquid phase is 45.04573814 and in gas phase is 1634.232899.&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562752</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562752"/>
		<updated>2016-11-03T21:31:34Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
With same approach as before, the integral under VACF is  in solid,  in liquid and in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is , in liquid phase is  and in gas phase is .&lt;br /&gt;
&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562747</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562747"/>
		<updated>2016-11-03T21:27:22Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit. The picture below illustrated these three distance.&lt;br /&gt;
[[File:Fcc pic.png]]&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=File:Fcc_pic.png&amp;diff=562745</id>
		<title>File:Fcc pic.png</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=File:Fcc_pic.png&amp;diff=562745"/>
		<updated>2016-11-03T21:26:17Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562731</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562731"/>
		<updated>2016-11-03T21:19:00Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances, which are 1.325, 1.675 and 2.025, between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.675 indicated by the second data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562717</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562717"/>
		<updated>2016-11-03T21:12:24Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562716</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562716"/>
		<updated>2016-11-03T21:12:15Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Appendix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
All the graphs obtained&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562712</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562712"/>
		<updated>2016-11-03T21:07:03Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\left [ cos\left ( \omega \tau  \right )\times \frac{1}{2} t-\frac{1}{4}\omega cos\left ( \omega \tau  \right )sin\left ( 2\omega t+2\phi  \right )+\frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right )  \right ]_{-\infty}^{\infty}}{\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562705</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562705"/>
		<updated>2016-11-03T21:01:15Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;C\left(\tau\right)=\left [ \frac{1}{2}t-\frac{1}{4} sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As t tends to infinity, &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{cos\left ( \omega \tau  \right )\times \frac{1}{2}t}{\frac{1}{2}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562682</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562682"/>
		<updated>2016-11-03T20:45:34Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The answer is &amp;lt;math&amp;gt;C\left ( \tau  \right )= cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The procedure of the evaluation is below&lt;br /&gt;
&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C(τ) =cos(ωτ)&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
	<entry>
		<id>https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562677</id>
		<title>Rep:SZ3614ls</title>
		<link rel="alternate" type="text/html" href="https://chemwiki.ch.ic.ac.uk/index.php?title=Rep:SZ3614ls&amp;diff=562677"/>
		<updated>2016-11-03T20:43:38Z</updated>

		<summary type="html">&lt;p&gt;Sz3614: /* Task */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Running Simulation==&lt;br /&gt;
* Using HPC system to perform input scripts which have different timesteps&lt;br /&gt;
* The timesteps are 0.001, 0.0025, 0.0075, 0.01 and 0.015&lt;br /&gt;
&lt;br /&gt;
==Molecular dynamic simulation==&lt;br /&gt;
===Task===&lt;br /&gt;
*complete column ANALYTICAL, ERROR, and ENERGY&lt;br /&gt;
ANALYTICAL is calculated by the classical harmonic oscillator equation. The position of a classical harmonic oscillator is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ANALYTICAL vs time graph obtained[[File:Analytical.png]]&lt;br /&gt;
&lt;br /&gt;
ERROR is the absolute value of the difference of ANALYTICAL and x(t). x(t) is already given in the file.&lt;br /&gt;
&lt;br /&gt;
ERROR vs time graph is obtained [[File:Error.png]]&lt;br /&gt;
&lt;br /&gt;
ENERGY is the total energy of the oscillator, &amp;lt;math&amp;gt;E_p + E_k = E_{total}&amp;lt;/math&amp;gt;, which is the sum of kinetic energy &amp;lt;math&amp;gt;E_k = \frac{1}{2} mv^2&amp;lt;/math&amp;gt; and the potential energy &amp;lt;math&amp;gt;E_p={1\over2}kx^2&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Energy vs time graph is obtained[[File:Energy.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find a graph of maxima ERROR vs time&lt;br /&gt;
&lt;br /&gt;
As shown in the graph below the appropriate function is y=0.0004x-0.00007&lt;br /&gt;
the graph is obtained [[File:Maxima error vs time.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*the timestep to ensure total energy changes not more than 1%&lt;br /&gt;
&lt;br /&gt;
When the timestep is changed to 0.12, the total energy change is not more than 1%. Because the minimum and maximum on the energy graph is still within 1% from the middle value of the energy.&lt;br /&gt;
&lt;br /&gt;
The energy vs time graph when timestep=0.12 is obtained[[File:When timestep=1.2.png]]&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the separation, the force at this separation, the equilibrium separation, the well depth and the evaluate several integrals.&lt;br /&gt;
The separation &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ when the potential energy is 0, via L-J potential equation&amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right) = 0 &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;\frac{\sigma^{6}}{r^{6}}=1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
thus &amp;lt;math&amp;gt;r_{0}&amp;lt;/math&amp;gt; = σ&lt;br /&gt;
&lt;br /&gt;
The force at this separation is 0 because the potential energy is 0 with the equation &amp;lt;math&amp;gt;\mathbf{F}_i = - \frac{\mathrm{d}U\left(\mathbf{r}^N\right)}{\mathrm{d}\mathbf{r}_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The equilibrium separation is when the L-J potential is at the minimum.&lt;br /&gt;
&lt;br /&gt;
Thus differentiation of L-J potential curve at this point should be equal to zero&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\partial \phi \left ( r \right )}{\partial r}&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Then &amp;lt;math&amp;gt;4\varepsilon \left ( \sigma^{12}r^{-12}- \sigma^{6}r^{-6}\right )&amp;lt;/math&amp;gt;=0&lt;br /&gt;
&lt;br /&gt;
Therefore &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The well depth is the potential well, at the equilibrium, the well depth is -\varepsilon , calculated by substitute  &amp;lt;math&amp;gt;r= \sqrt[6]{2}\sigma&amp;lt;/math&amp;gt; back into &amp;lt;math&amp;gt;\phi\left(r\right) = 4\epsilon \left( \frac{\sigma^{12}}{r^{12}} - \frac{\sigma^6}{r^6} \right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The integrals &amp;lt;math&amp;gt;\int_{2\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=-0.02482, &amp;lt;math&amp;gt;\int_{2.5\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;-8.177\times 10^{-3}&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;\int_{3\sigma}^\infty \phi\left(r\right)\mathrm{d}r&amp;lt;/math&amp;gt; =&amp;lt;math&amp;gt;-3.2901\times 10^{-3}&amp;lt;/math&amp;gt;  when &amp;lt;math&amp;gt;\sigma = \epsilon = 1.0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*no. of water molecule in 1 ml water and volume of 10000 water molecules under under standard conditions.&lt;br /&gt;
The number of water molecule is &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;, via mass/volume equation and Avogadro&#039;s number with the calculation &amp;lt;math&amp;gt;1\div 18\times 6.022\times 10^{23}&amp;lt;/math&amp;gt;= &amp;lt;math&amp;gt;3.346\times 10^{22}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The volume is &amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt; with the calculation &amp;lt;math&amp;gt;10000\div \left ( 6.022\times 10^{23}\right )\times 18&amp;lt;/math&amp;gt;=&amp;lt;math&amp;gt;2.99\times 10^{-19}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*After boundary condition, the point where it ends up at&lt;br /&gt;
It first goes to (1.2, 1.1, 0.7). As the atom goes outside the box, there is another stom goes in the box.&lt;br /&gt;
&lt;br /&gt;
The end up point is (0.2, 0.1, 0.7).&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The real unit of distance and temperature. the well depth value.&lt;br /&gt;
the real r=1.088 m (&amp;lt;math&amp;gt;r=r^{*}\times \sigma= 3.2\times 0.34= 1.088&amp;lt;/math&amp;gt;)and the real T= 180 K (&amp;lt;math&amp;gt;T=T^{*}\times \frac{\epsilon }{k_{B}}= 1.5\times 120= 180 K&amp;lt;/math&amp;gt;), via the L-J parameters&lt;br /&gt;
Well depth Ԑ in &amp;lt;math&amp;gt;kJmol^{-1} &amp;lt;/math&amp;gt; &lt;br /&gt;
&amp;lt;math&amp;gt;\epsilon\ /\ k_B= 120 \mathrm{K}&amp;lt;/math&amp;gt; with Boltzmann&#039;s constant is approximately &amp;lt;math&amp;gt;1.3807\times 10^{-23}&amp;lt;/math&amp;gt; joules per kelvin&lt;br /&gt;
&lt;br /&gt;
thus Ԑ = &amp;lt;math&amp;gt;2.75\times 10^{-48}&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;\mathrm{kJ\ mol}^{-1}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Equilibration==&lt;br /&gt;
===Task===&lt;br /&gt;
* Why random starting coordinates causes problem.&lt;br /&gt;
As two atoms get closer together due to the attraction, they lose potential energy. This energy is liberated as heat. [citation] The computational technique cannot handle the infinite potential therefore the atoms are going to blow up (going far away outside of the simulation box).&lt;br /&gt;
===Task===&lt;br /&gt;
*for ffc lattice, with lattice point number density 1.2, find the side length of the cubic unit cell&lt;br /&gt;
The ffc has four lattice point per one unit cell. Therefore the side length should be &amp;lt;math&amp;gt;\sqrt[3]{4\div 1.2}&amp;lt;/math&amp;gt; = 1.494&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*The number of atoms created for ffc lattice via command &lt;br /&gt;
the command create_atom is to create 1 box which is 1000 unit cells. The ffc has four atoms per unit cell. Therefore, 4000 atoms would be created.&lt;br /&gt;
===Task===&lt;br /&gt;
*find the purpose of some commands&lt;br /&gt;
mass 1 1.0: 1 means the atome type is 1, 1.0 means the mass is 1.0&lt;br /&gt;
&lt;br /&gt;
pair_style lj/cut 3.0: lj/cut is the style, 3.0 is the argument &lt;br /&gt;
&lt;br /&gt;
pair_coeff * * 1.0 1.0: ** sets the coefficients for all I J pairs, 1.0 is the argument which is the coefficient for one or more pairs of atom types&lt;br /&gt;
===Task===&lt;br /&gt;
===Task===&lt;br /&gt;
*[[File:The question about the equilibrition.png]]&lt;br /&gt;
Use the variable instead just use the number, which allows us to change the variable efficiently. In a script, the variable will occur several times. If we want to change the variable value, we can simple change it at the second line instead of changing it several times in a scrpt.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plots of energy, temperature and pressure against time. equilibrium(how long to reach).  plot of energy vs time. find a good timestep.&lt;br /&gt;
The plot of energy, temperature, pressure against time for 0.001 timestep is obtained.[[File:0.001 timestep nergy, temperature, and pressure, against time.png]]&lt;br /&gt;
The simulation reached equilibrium as the constant energy, temperature, and pressure have obtained with a little bit fluctuation.It takes 0.39s for energy, 0.95s for temperature, 2.24s for pressure.&lt;br /&gt;
&lt;br /&gt;
The plot of energy vs time for all timestep is obtained.[[File:All timestep energy vs time.png]]&lt;br /&gt;
&lt;br /&gt;
The largest timestep to give acceptable results is 0.01 because the simulation still reaches equilibrium even though very scattered graph.&lt;br /&gt;
&lt;br /&gt;
The 0.015 timestep gives bad results. The slope of the energy vs time graph is too large and the simulation does not reach equilibrium&lt;br /&gt;
&lt;br /&gt;
==Simulation with specific conditions==&lt;br /&gt;
===Task===&lt;br /&gt;
*choose five temperatures and two pressures &lt;br /&gt;
pressure: 2.65, 2.80 ( with the average pressure of simulations when the timestep is 0.001 as a basic idea)&lt;br /&gt;
&lt;br /&gt;
Temperature: 1.5, 2.0, 2.5, 3.0, 3.5 (the critical temperature &amp;lt;math&amp;gt;T^* = 1.5&amp;lt;/math&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
Timestep: 0.001(the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality)&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*find &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i v_i^2 = \frac{3}{2} N k_B T&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\frac{1}{2}\sum_i m_i \left(\gamma v_i\right)^2 = \frac{3}{2} N k_B \mathfrak{T}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we want &amp;lt;math&amp;gt;\gamma&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;T = \mathfrak{T}&amp;lt;/math&amp;gt;, then two equations above should equal to each other.&lt;br /&gt;
&lt;br /&gt;
After rearranging the equations, we get &amp;lt;math&amp;gt;\gamma =\sqrt{\frac{\mathfrak{T}}{T}}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Find the importance of the three numbers 100 1000 100000. how often the values be sampled for average. How many measurements contribute to the average. How much time for simulation.&lt;br /&gt;
100 is the Nevery = use input values every this many timesteps&lt;br /&gt;
1000 is the Nrepeat = # of times to use input values for calculating averages&lt;br /&gt;
10000 is the Nfreq = calculate averages every this many timesteps&lt;br /&gt;
&lt;br /&gt;
Every 100 steptime the values be sampled for average&lt;br /&gt;
&lt;br /&gt;
1000 measurements contribute to the average&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;100000\times 0.001= 100s&amp;lt;/math&amp;gt; for simulation&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*plot of density vs temperature with error bars. a line corresponding to the density predicted by the ideal law.&lt;br /&gt;
The plot is obtained.&lt;br /&gt;
&lt;br /&gt;
The density predicted by the ideal law can be calculated with &amp;lt;math&amp;gt;PV = nRT&amp;lt;/math&amp;gt;, and &amp;lt;math&amp;gt;N/V&amp;lt;/math&amp;gt; is density so &amp;lt;math&amp;gt;p=density*RT&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:Correct density vs t and gas law.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Is your simulated density lower or higher? Does the discrepancy increase or decrease with pressure?&lt;br /&gt;
Corresponding to the graph above, the simulated density is lower than the density calculated by ideal gas law. &lt;br /&gt;
&lt;br /&gt;
As the gas law assumption says that there are no (or entirely negligible) intermolecular forces between the gas molecules. This means molecules in gas phases can stick together without considering the intermoleclar forces, which indicates that the density calculated by ideal gas law should be higher than the real density. &lt;br /&gt;
&lt;br /&gt;
According to the graph above, the discrepancy increases with pressure.&lt;br /&gt;
&lt;br /&gt;
==Heat Capacity==&lt;br /&gt;
===Task===&lt;br /&gt;
*Plot C_V/V as a function of temperature. Attach an input script.&lt;br /&gt;
The plot of Cv/V vs Temperature is obtained.[[File:CvV vs T.png]]&lt;br /&gt;
&lt;br /&gt;
*Is the trend the one you would expect?&lt;br /&gt;
&lt;br /&gt;
Yes. As shown in the graph, Cv/V decreases with the increasing temperature. (V remain the same when the density remain the same) As &amp;lt;math&amp;gt;C_V = \frac{\partial E}{\partial T}&amp;lt;/math&amp;gt;, the graph is consistent with the theory.&lt;br /&gt;
&lt;br /&gt;
*An input scripts when density=0.2 and temperature=2.0 (see below)&lt;br /&gt;
&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart1.png]]&lt;br /&gt;
[[File:D=0.2 t=2.0 inputpart2.png]]&lt;br /&gt;
&lt;br /&gt;
==Radical distribution Function==&lt;br /&gt;
===Task===&lt;br /&gt;
*calculate &amp;lt;math&amp;gt;g(r)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\int g(r)\mathrm{d}r&amp;lt;/math&amp;gt;. Plot the RDFs for the three systems on the same axes. &lt;br /&gt;
The plot of RDFs for three systems is obtained [[File:Rdf for three systems.png]]&lt;br /&gt;
&lt;br /&gt;
The RDF here is a function of the interatomic separation. Three RDFs all showing that at small r, the RDF is zero because of the atoms cannot approach any more closely. Also, significant peaks indicate that atoms pack around each other in &#039;shells&#039; of neighbours. Finally, as r increases, RDFs tend to be 1 because RDF is the average density at this range.&lt;br /&gt;
*Qualitatively the differences between the three RDFs:&lt;br /&gt;
&lt;br /&gt;
In solid, the atoms are positioned at lattice point, therefore, the peaks are very sharp.&lt;br /&gt;
As the distance between atoms become further, the liquid is behaving like the gas, as there is no peaks.&lt;br /&gt;
*The structure of the system in each phase. &lt;br /&gt;
In solid phase, the molecules are tightly bound to each other; in liquid phase, the molecules are more loosely bounded to each other which allows them to move; in gas phase, the molecules are free to move within a large distance.&lt;br /&gt;
*In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?&lt;br /&gt;
Integral of g(r) obtained[[File:Integral of rdf in solid.png]]&lt;br /&gt;
&lt;br /&gt;
Three plateaus in integral of g(r) graph indicated the number of atoms that can be found at certain distances.&lt;br /&gt;
&lt;br /&gt;
The first three peaks are the three shortest distances between two lattice point in a fcc unit.&lt;br /&gt;
&lt;br /&gt;
The lattice spacing is 1.325 indicated by the data point (1.325, 0.187694215) on the solid RDF graph.&lt;br /&gt;
&lt;br /&gt;
==Dynamic==&lt;br /&gt;
===Task===&lt;br /&gt;
*a plot showing the &amp;quot;total&amp;quot; MSD vs timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Msd vs timestep.png]]&lt;br /&gt;
&lt;br /&gt;
The plot is not linear for a short time in the gas graph. This is because the path a molecule takes will only be an approximate straight line until it collides with its neighbour. In gas, the molecule ate far away from each other, therefore this is what we would expect.&lt;br /&gt;
&lt;br /&gt;
*Estimate D in each case&lt;br /&gt;
As &amp;lt;math&amp;gt;D = \frac{1}{6}\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;, to find &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt; is to plot a graph of total MSD vs actual time.&lt;br /&gt;
&lt;br /&gt;
Then we get the slope from the graph which is &amp;lt;math&amp;gt;\frac{\partial\left\langle r^2\left(t\right)\right\rangle}{\partial t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we can calculate &amp;lt;math&amp;gt;D&amp;lt;/math&amp;gt;. (the values are in the picture below)&lt;br /&gt;
The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value.png]]&lt;br /&gt;
*the same procedure with the one million atom simulations&lt;br /&gt;
Again, The solid phase does not have a diffusion coefficient because the atoms are not diffusing.&lt;br /&gt;
[[File:Msd vs time and D value for one million atom.png]]&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*evaluate C(τ) , plot C(τ) vs timestep and VACF vs timestep&lt;br /&gt;
The position of a 1D harmonic oscillator as a function of time is &amp;lt;math&amp;gt; x\left(t\right) = A\cos\left(\omega t + \phi\right)&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\left ( t \right )= \frac{\mathrm{d} x\left ( t \right )}{\mathrm{d} t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;V\left ( t \right )= -A\omega sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As given &amp;lt;math&amp;gt;C\left(\tau\right) = \frac{\int_{-\infty}^{\infty} v\left(t\right)v\left(t + \tau\right)\mathrm{d}t}{\int_{-\infty}^{\infty} v^2\left(t\right)\mathrm{d}t}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;C\left(\tau\right)=\frac{\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt}{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Fist, we work on the denominator which is &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt }&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we know &amp;lt;math&amp;gt;sin^{2}\left ( \omega t+\phi  \right )= \frac{1}{2}-\frac{1}{2}cos\left ( 2\omega t+2\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \int_{-\infty}^{\infty} \frac{1}{2} dt- \int_{-\infty}^{\infty} \frac{1}{2}cos\left ( 2\omega t+2\phi  \right )dt&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Secondly, we work on the numerator which is &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Expand the sin equation, &amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt = \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) \left ( sin\left ( \omega t+\phi  \right )cos\left ( \omega \tau  \right ) + cos\left ( \omega t+\tau  \right )sin\left ( \omega \tau  \right ))\right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As &amp;lt;math&amp;gt;cos\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )&amp;lt;/math&amp;gt; are constant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right ) sin\left ( \omega t+\omega \tau +\phi  \right )dt =cos\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin^{2}\left ( \omega t+\phi  \right )dt+ sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We already know &amp;lt;math&amp;gt;{\int_{-\infty}^{\infty}sin^{2}\left ( \omega t+\phi  \right )dt } = \left [ \frac{1}{2}t-\frac{1}{4} \omega \times  sin\left ( 2\omega t+2\phi  \right )\right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore, we are focusing on &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;this part&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;U= sin\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;\frac{\mathrm{d} U}{\mathrm{d} t}=\frac{1}{\omega }cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Substitute &amp;lt;math&amp;gt;cos\left ( \omega t+\phi  \right )&amp;lt;/math&amp;gt; back in &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore we get &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right )\int_{-\infty}^{\infty}U\omega dU&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus &amp;lt;math&amp;gt;sin\left ( \omega \tau  \right ) \int_{-\infty}^{\infty} sin\left ( \omega t+\phi  \right )cos\left ( \omega t+\phi  \right )dt = \left [ \frac{1}{2}\omega sin\left ( \omega \tau  \right )sin^{2}\left ( \omega t+\phi  \right ) \right ]_{-\infty}^{\infty}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
C(τ) =cos(ωτ)&lt;br /&gt;
&lt;br /&gt;
Plot obtained[[File:VACF and C(tau).png]]&lt;br /&gt;
The minima in the VACFs for the liquid and solid system, very damped oscillations, represent a collision between two atoms.&lt;br /&gt;
&lt;br /&gt;
Even though liquid behave similarly to solids, atoms are close to each other, there are differences between the liquid and solid VACFs. &lt;br /&gt;
&lt;br /&gt;
Because in solid the atoms are fixed at regularly positions, their motion is an oscillation. This is why we have a function that oscillates strongly from positive to negative value and back again.&lt;br /&gt;
&lt;br /&gt;
In liquid, two atoms collide before they rebound from one another and diffuse away.&lt;br /&gt;
&lt;br /&gt;
The harmonic oscillator VACF is cos(ωτ) vs time. Since &amp;lt;math&amp;gt;\omega = 1/2\pi&amp;lt;/math&amp;gt;, τ the timestep is the variable here. Since cos function is a periodic function, the shape of harmonic oscillator VACF is very different to the Lennard Jones solid and liquid.&lt;br /&gt;
&lt;br /&gt;
===Task===&lt;br /&gt;
*Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. Are they as you expect?  What do you think is the largest source of error in your estimates of D from the VACF?&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;math&amp;gt; \int_{a}^{b} f(x)\, dx \approx \frac{h}{2} \sum_{k=1}^{N} \left( f(x_{k+1}) + f(x_{k}) \right)&amp;lt;/math&amp;gt; &amp;lt;math&amp;gt;{}= \frac{b-a}{2N}(f(x_1) + 2f(x_2) + 2f(x_3) + 2f(x_4) + \dotsb + 2f(x_N) + f(x_{N+1})).&amp;lt;/math&amp;gt; equation, the integral under VACF is 0.803506332 in solid, 119.1372588 in liquid and 1277.155395 in gas.&lt;br /&gt;
&lt;br /&gt;
Therefore, the D in solid phase is 0.267835444, in liquid phase is 39.71241959 and in gas phase is 425.718465. &lt;br /&gt;
&lt;br /&gt;
As &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;, we can calculate D by dividing the integral under the velocity autocorrelation function by three.&lt;br /&gt;
*A plot of the running integral&lt;br /&gt;
[[File:Running integral summary.png]]&lt;br /&gt;
&lt;br /&gt;
According to the graphs of VACF vs timestep, the running integral plots are reasonable.&lt;br /&gt;
*Repeat this procedure for the VACF data that you were given from the one million atom simulations.&lt;br /&gt;
[[File:Running integral summary for one million.png]]&lt;br /&gt;
&lt;br /&gt;
==Conclusion&amp;amp;Summary==&lt;br /&gt;
*We run the simulations with different timesteps to compare which timestep is more accurate. &lt;br /&gt;
*With the velocity-Verlet algorithm and the Lennard-Jones potential, boundary conditions and reduce unit, we understand the theory for the simulation.&lt;br /&gt;
*Analyse the output of the simulation with thermodynamic properties to check the equilibrium.&lt;br /&gt;
*Under NpT conditions, plotting the equation of different states.&lt;br /&gt;
*Heat capacities are obtained in density-temperature phase space with the calculation of statistical physics.&lt;br /&gt;
*Radical distribution functions are obtained to understand how, on average, the atoms in a system are radially packed around each other.&lt;br /&gt;
*Mean Squared Displacement and Velocity Autocorrelation Function are obtained to understand how the square distance grows with time (since is squared, it will not be sums up to zero with both positive and negative values )&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
==Appendix==&lt;br /&gt;
The specific calculation for all tasks&lt;/div&gt;</summary>
		<author><name>Sz3614</name></author>
	</entry>
</feed>