Jump to content

Talk:Mod:thk213

From ChemWiki

JC: General comments: Good report which demonstrates a good understanding of the experiment and your explanations of your results and graphs are clear and well thought out. Look into the background theory a bit more to get a deeper understanding of what each step involves.

Introduction

In this assignment, simulation of liquid is conducted using the Visual Molecular Dynamics (VMD) to understand the molecular motion described by equation of motions in Newton classical mechanics and properties of liquid i.e. heat capacity and compared with different models including radial distribution functions (RDF), mean squared velocity displacement (MSD) and velocity autocorrelation function (VACF).

JC: You use LAMMPS to perform the simulation, VMD is only used to visualise the results.

Introduction to Molecular Dynamics Simulation

TASK 1: Open the file HO.xls. In it, the velocity-Verlet algorithm is used to model the behaviour of a classical harmonic oscillator. Complete the three columns "ANALYTICAL", "ERROR", and "ENERGY": "ANALYTICAL" should contain the value of the classical solution for the position at time t, "ERROR" should contain the absolute difference between "ANALYTICAL" and the velocity-Verlet solution (i.e. ERROR should always be positive -- make sure you leave the half step rows blank!), and "ENERGY" should contain the total energy of the oscillator for the velocity-Verlet solution. Remember that the position of a classical harmonic oscillator is given by x(t)=Acos(ωt+ϕ)(the values of A, ω, and ϕ are worked out for you in the sheet).

Using the classical harmonic oscillator equation, the positions of the atoms are calculated using A=1, ω=1, and ϕ=0. The "Error" column is completed by finding the difference between the position values obtained from velocity-Verlet and the classical harmonic oscillator equation. The "Energy" is obtained by substituting m=1 and corresponding velocities using (1).

KE=12mivi2(1)

By inspection from Figure 1, maxima occur at a specific range. Using "Conditional Formatting" function in Excel, the positions of the maxima are determined accurately. The positions of the maxima are plotted as a function of time to generate a straight line with y=0.004x7×105 as shown in Figure 2. We can see the error is getting larger and larger over time. Maximum at each range increases. The error reaches a maximum point and fall back to zero and this repeats continuously. When the simulated and velocity-Verlet oscillate at the same time, the error is maximised and this is the peak at each range.

JC: You should calculate the total energy, not just the kinetic energy.

File:Figure 1 - A plot showing the difference of solutions obtained between the velocity-Verlet and classical harmonic oscillator equation.png
Figure 1 - A plot showing the difference of solutions obtained between the velocity-Verlet and classical harmonic oscillator equation

TASK 2: For the default timestep value, 0.1, estimate the positions of the maxima in the ERROR column as a function of time. Make a plot showing these values as a function of time, and fit an appropriate function to the data.

File:Figure 1 - A plot showing the maximum difference between the classical harmonic oscillator and the velocity Verlet solutions against time.png
Figure 2 - A plot showing the maximum difference between the classical harmonic oscillator and the velocity Verlet solutions against time

Table 1

Time Maxima
2.00 7.58E-4
4.90 2.01E-3
8.00 3.30E-3
11.10 4.60E-3
14.20 5.91E-3

From this plot, we can see the maximum of error increases linearly over time.

TASK 3: Experiment with different values of the timestep. What sort of a timestep do you need to use to ensure that the total energy does not change by more than 1% over the course of your "simulation"? Why do you think it is important to monitor the total energy of a physical system when modelling its behaviour numerically?

As the timesteps increases from 0.1, the change in magnitude of total energy decreases significantly. A small change in timestep results a big change in total energy. At timestep = 1.98, the total energy change over the course of the simulation is within 1%,shown in Figure 3. However, when the timestep further raises to 2, the total energy is effectively constant which shows as a straight line and the oscillating behavior observed disappears. It is crucial to monitor and ensure the total energy of a system to approach a nearly constant based on the Law of Conservation of Energy, a fundamental principle built on the Noether's theorem. Total energy of the system must remain constant as time changes.

JC: Good choice of timestep. Why did the oscillatory behaviour disappear when timestep is increased to 2?

File:The total energy at timestep 1.98.png
Figure 3 - A plot showing the total energy of the system at timestep 1.98

TASK 4: For a single Lennard-Jones interaction, ϕ(r)=4ϵ(σ12r12σ6r6), find the separation, r0, at which the potential energy is zero. What is the force at this separation? Find the equilibrium separation, req, and work out the well depth (ϕ(req)). Evaluate the integrals 2σϕ(r)dr, 2.5σϕ(r)dr, and 3σϕ(r)dr when σ=ϵ=1.0.

Find r0 and the force at this separation

Potential energy is zero at r=r0

ϕ(r0)=4ϵ(σ12r012σ6r06)=0

σ12r012=σ6r06

r06=σ6

r0=σ

To find the force exerted at this separation, we need to understand that force can be expressed as followings in terms of potential:

Fi=dU(rN)dri

So we differentiate the ϕ(r0) function with respect to r and we substitute r0=σ to obtain the force:

F=dUdr(r0=σ)=4ϵ(12σ12σ13+6σ6σ7)=4ϵ(12σ+6σ)

F=4ϵ(6σ)=24ϵσ

Find the equilibrium separation, req, and work out the well depth (ϕ(req))

Equilibrium separation is achieved when the force is at minimum (i.e. Fi=dUdr=0)

12σ12req13+6σ6req7=0

12σ12req13=6σ6req7

req6=2σ6

req=21/6σ


At req=21/6σ, ϕ(req)=ϵ

Evaluate the integrals 2σϕ(r)dr, 2.5σϕ(r)dr, and 3σϕ(r)dr when σ=ϵ=1.0

2σϕ(r)dr=0.0248

2.5σϕ(r)dr=0.00818

3σϕ(r)dr=0.00329

σ is the distance at which the intermolecular potential between the two particles is zero. When the distance increases, the values become less negative.

JC: The maths is correct, except that the force at r0 which has the right magnitude, but should be positive rather than negative.

TASK 5:: Estimate the number of water molecules in 1ml of water under standard conditions. Estimate the volume of 10000 water molecules under standard conditions.

Density of water = 1gcm1

Mass of water in 1 mL of water = 1g

No. of moles of water molecule in 1 mL of water = 0.0556mol

No. of water molecules in 1 mL of water = 3.34×1022

Using the ratio, the volume of 10000 water molecules can be found directly.

10000V=3.34×10221

V=100003.34×1022=2.99×1019mL

JC: Both calculations are correct, remember density should have units of g cm-3.

TASK 6: Consider an atom at position (0.5,0.5,0.5) in a cubic simulation box which runs from (0,0,0) to (1,1,1). In a single timestep, it moves along the vector (0.7,0.6,0.2). At what point does it end up, after the periodic boundary conditions have been applied?.

The new position of the atom is (1.2,1.1,0.7). This is beyond the volume of a cubic box. After the periodic boundary conditions have been applied, the atom ends up at (0.2,0.1,0.7).

JC: Correct.

TASK 7: The Lennard-Jones parameters for argon are σ=0.34nm,ϵ/kB=120K. If the LJ cutoff is r*=3.2, what is it in real units? What is the well depth in kJmol1? What is the reduced temperature T*=1.5 in real units?

Find r in real units and the corresponding well depth in kJmol1

3.2=r0.34

r=3.2×0.34=1.09nm

ϵ=kB×120=1.38×1023×120=1.66×1021J

ϕ(r0)=4ϵ(σ12r012σ6r06)×A

ϕ(r0)=3.09×105kJmol1

Find the reduced temperature T*=1.5 in real units

1.5=kB×Tϵ

1.5=8.33×103×T

T=180K

JC: Values of r and T are correct. You have shown above that the well depth is given by ϵ, what value of r have you used here as r0?

Equilibration

TASK 8: Why do you think giving atoms random starting coordinates causes problems in simulations? Hint: what happens if two atoms happen to be generated close together?

Atoms in liquid are close together with no regular arrangement. To ensure we are simulating atoms in liquid, we need to specify the starting coordinates of the atoms. If the coordinates of two atoms generated are already too close together, the electrons in the orbital repel each other substantially and push the two atoms apart at a constant distance. This models the atom arrangement similar to a solid,which atoms are locked into place and has a long range order. The accumulation of large repulsive forces can crash down the simulation later on. If the coordinates of two atoms generated are too far, the atoms are well separated, behaving like a gas without any order.

JC: Correct, however, these simulations are purely classical so the repulsion is just due to the potential, not due to any quantum mechanical effects.


TASK 9: Satisfy yourself that this lattice spacing corresponds to a number density of lattice points of 0.8. Consider instead a face-centred cubic lattice with a lattice point number density of 1.2. What is the side length of the cubic unit cell?

Number of lattice point in simple cubic structure = 1

Numberdensity=NumberoflatticepointVolumeofthecubicunitcell=11.00723=0.8

Number of lattice points in FCC structure = 4

Assume side length of the cubic unit cell = a

1.2=4a3

a=1.494(inreducedunits)

TASK 10: Consider again the face-centred cubic lattice from the previous task. How many atoms would be created by the create_atoms command if you had defined that lattice instead?

As mentioned before, there are 4 lattice points in face-centred cubic lattice.

There are 1000 unit cells therefore 4000 atoms are created using the create_atoms command.

JC: Correct.


TASK 11: Using the LAMMPS manual, find the purpose of the following commands in the input script:

mass 1 1.0
pair_style lj/cut 3.0
pair_coeff * * 1.0 1.0
mass 1 1.0

This is a mass command, indicating the mass of atom type 1 in the lattice box is equal to 1.0. The 1 in the middle specifies the atom type while 1.0 specifies the mass value of this atom type. It does not specify the style in this line. But we are dealing with lj style in this case so I assume the style is lj and the quantity is unitless.

 pair_style lj/cut 3.0 

This command states that we only consider Lennard Jones Potential (LJP) of the atom pairs within 3 distance units. In this case, lj/cut 3.0 computes the global cut off of the LJP is 3. The potential of atom pairs greater than 3 distance units is zero.

 pair_coeff * * 1.0 1.0 

This command computes the pairwise force field coefficients of pairs of atom types. As the style we are working is LJP, the leading 1.0 represents the ϵ in LJP is equal to 1 while the latter represents the σ in LJP is equal to 1 as well for all atom types from 1 to n (inclusive) and from n to N (inclusive) where n is an atom type and N is the number of atom types.ϵ is the well depth which measures the extent of two atoms attracting each other; σ is the distance at which the potential between two atoms is zero.

JC: Good description of these commands, what's the advantage of using a Lennard Jones potential with a cut off?

TASK 12: Given that we are specifying xi(0) and vi(0), which integration algorithm are we going to use?

We are going to use the velocity-Verlet algorithm as shown in (2).

vi(t+δt)=vi(t+12δt)+12ai(t+δt)δt(2)

TASK: Look at the lines below.

### SPECIFY TIMESTEP ###
variable timestep equal 0.001
variable n_steps equal floor(100/${timestep})
variable n_steps equal floor(100/0.001)
timestep ${timestep}
timestep 0.001

### RUN SIMULATION ###
run ${n_steps}
run 100000

The second line (starting "variable timestep...") tells LAMMPS that if it encounters the text ${timestep} on a subsequent line, it should replace it by the value given. In this case, the value ${timestep} is always replaced by 0.001. In light of this, what do you think the purpose of these lines is? Why not just write:

timestep 0.001
run 100000

Both yield the same outcome but the first method provides a more time-saving way if we need to change the number of timestep or the amount of time we want to run for different simulations. By doing so, instead of changing the timesteps or the length of simulation time line by line which incurs mistakes, we just need to change the value of the timestep for the timestep in line 2 and every lines with variable depending on this value will be changed accordingly, including the n_step variable as we see in line 3. This is also a convenient way to check if there is any problem in the script.

JC: Good explanation.

TASK 13: make plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment (attach a picture to your report). Does the simulation reach equilibrium? How long does this take? When you have done this, make a single plot which shows the energy versus time for all of the timesteps (again, attach a picture to your report). Choosing a timestep is a balancing act: the shorter the timestep, the more accurately the results of your simulation will reflect the physical reality; short timesteps, however, mean that the same number of simulation steps cover a shorter amount of actual time, and this is very unhelpful if the process you want to study requires observation over a long time. Of the five timesteps that you used, which is the largest to give acceptable results? Which one of the five is a particularly bad choice? Why?

As soon as the energy levels off at a fairly stable value approximately at t = 0.38, equilibrium is attained. As we see from Figure 5 and 6, average temperature and pressure also settle down at similar times. A plot of energy as a function of time for all the timesteps is plotted as Figure 7. As shown in Figure 7, timestep 0.001 and 0.0025 yield similar outcomes with minimized fluctuations of total energy, indicating the total energy is well conserved. For timesteps = 0.0075 and 0.01, the energy still levels off but at a value higher than the ones conducted with timestep 0.001 and 0.0025 with greater fluctuations. Timestep 0.015 is a bad choice as the simulation has completely destablized and the average energy does not level off. Equilibration state is not reached using this timestep. The total energy reaches at a minimum value at instant time but then oscillates with much bigger amplitude over time. The dynamic breaks down after reaching the maximum limit of timestep perhaps at t = 0.01. The two atoms are being too close together with this timestep, experiencing significant repulsive force therefore inducing significant errors in the simulation. The maximum timestep value is restricted by the higher order time derivatives neglected from the Taylor expansion in the velocity-Verlet algorithm used in this simulation.

File:Figure 4 - Plot showing the total energy of the system as a function of time for timestep 0.001 experiment.png
Figure 4 - A plot showing the total energy of the system as a function of time for timestep 0.001 experiment
File:Figure 5 - Plot showing the temperature of the system as a function of time for timestep 0.001 experiment.png
Figure 5 - A plot showing the temperature of the system as a function of time for timestep 0.001 experiment
File:Figure 6 - Plot showing the pressure as a function of time for timestep 0.001 experiment.png
Figure 6 - A plot showing the pressure as a function of time for timestep 0.001 experiment
File:Figure 7 - A plot of total energy as a function of time with different timesteps.png
Figure 7 - A plot of total energy as a function of time with different timesteps

JC: Energy should be independent of timestep, so the timestep should be chosen to ensure that this is the case, choosing 0.0025 is a good idea.

Running simulations under specific conditions

TASK 14: Choose 5 temperatures (above the critical temperature T*=1.5), and two pressures (you can get a good idea of what a reasonable pressure is in Lennard-Jones units by looking at the average pressure of your simulations from the last section). This gives ten phase points — five temperatures at each pressure. Create 10 copies of npt.in, and modify each to run a simulation at one of your chosen (p,T) points. You should be able to use the results of the previous section to choose a timestep. Submit these ten jobs to the HPC portal. While you wait for them to finish, you should read the next section.

Timestep 0.0025 is chosen as this is the largest acceptable timestep according to the results in the previous section which gives minimal fluctuations over time. Temperatures chosen are 1.7,1.9,2.1,2.3 and 2.5 while the pressure are 2.5 and 2.7.

TASK 15: We need to choose γ so that the temperature is correct T=𝔗 if we multiply every velocity γ. We can write two equations:

12imivi2=32NkBT

12imi(γvi)2=32NkB𝔗

Solve these to determine γ.

T=𝔗

After rearranging the terms,

T=𝔗=13NkBimivi2=13NkBimi(γvi)2

γ=(𝔗T)1/2

JC: The result is correct, but the steps in your derivation are not very clear, especially writing T=𝔗 which is not correct.

TASK 16: Use the manual page to find out the importance of the three numbers 100 1000 100000. How often will values of the temperature, etc., be sampled for the average? How many measurements contribute to the average? Looking to the following line, how much time will you simulate?

The three number specifies on what timesteps the input values are used to find the final average. 100 refers to Nevery, which means the input values are used every 100 timesteps; 1000 refers to Nrepeat, which means 1000 steps are used to find the final average on 100000 timestep; 100000 refers to Nfreq, which means the system will calculate the final average on 100000 timestep. So for our case, the values on timesteps 100,200,300,400,500,600,700,800,900,1000 will be used to compute the final average on timestep 100000.

JC: You are not just using timesteps up to 1000 for the averaging. The average will be calculated on 1000 points each 100 timesteps apart: 100, 200, 300, ..., 99900, 100000.

TASK 17: When your simulations have finished, download the log files as before. At the end of the log file, LAMMPS will output the values and errors for the pressure, temperature, and density (NV). Use software of your choice to plot the density as a function of temperature for both of the pressures that you simulated. Your graph(s) should include error bars in both the x and y directions. You should also include a line corresponding to the density predicted by the ideal gas law at that pressure. Is your simulated density lower or higher? Justify this. Does the discrepancy increase or decrease with pressure?

Equation (3) and (4) show the ideal gas equation and van der Waals equation respectively.

PV=NkBT(3)
(P+an2v2)(Vnb)=nRT(4)

We are dealing with reduced units in the simulation therefore kB=1

PT=NV

By substituting the corresponding temperature and pressure, pressure divided by the temperature is equal to the density.

Using the equations of state plotted in Figure 8, we can see how well our simulated results fit the ideal gas law equation. Ideal gas law model assumes all collisions between atoms (point masses) are perfectly elastic and neglects any attractive or repulsive interactions between atoms. As we can see, at constant pressure, density decreases as temperature increases. At higher temperature, atoms have higher kinetic energy and they can spread out more and move master, resulting in a higher volume and a lower density. The simulated density is half of the density predicted by ideal gas law. Error bars are fit into the simulated graphs only for both x and y directions. Under the ideal gas law conditions, the increase in volume is much less as the volume occupied by particles is negligible in this case compared to the volume of the box, resulting a higher density. The discrepancy increases with higher pressure and lower temperature. At higher pressure, atoms are closer together and volume occupied is larger than expected value predicted from the ideal gas equation.

van der Waals equation gives a more realistic and better prediction than ideal gas equation of how the density vary as temperature changes because it includes the two correction terms in the equation. The an2v2 term corrects the attraction forces between atoms while the nb takes into account of the excluded volume. a and b are van der Waals coefficients subject to a specific type of atom. If the attraction is stronger, a will be larger.

File:Figure 8 - A plot showing the density as a function of temperature at 2 different pressures at timestep = 0.0025.png
Figure 8 - A plot showing the density as a function of temperature at 2 different pressures at timestep = 0.0025

JC: Good explanation, the van der Waal's equation would give a better fit to the simulated data than the ideal gas law. Talking about collisions in the ideal gas could be a bit misleading though as there are no interactions between particles.

Calculating heat capacities using statistical physics

TASK 18: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature (ρ*,T*) phase space, rather than pressure-temperature phase space. The two densities required at 0.2 and 0.8, and the temperature range is 2.0,2.2,2.4,2.6,2.8. Plot CV/V as a function of temperature, where V is the volume of the simulation cell, for both of your densities (on the same graph). Is the trend the one you would expect? Attach an example of one of your input scripts to your report.

Heat capacity is given by (5), where N is the number of atoms,

CV=ET=Var[E]kBT2=N2E2E2kBT2(5)

10 simulations are run in canonical ensemble (NVT). Before generating the average temperature and the heat capacity, we need to prepare a system at equilibrium by melting a crystal. This is done by modifying the npt.in file we used in the previous section and change it to canonical ensemble. An example of the script is attached in the report. As we have set the constraint at constant volume, pressure is not allowed to change. After switching off the thermostat using the LAMMPS command, we run the simulations in 100000 steps. The results of the simulation are shown in Figure 9.

Here is the input script for the simulation of ρ = 0.2 and T=2.8:


### DEFINE SIMULATION BOX GEOMETRY ###
lattice sc 0.2
region box block 0 15 0 15 0 15
create_box 1 box
create_atoms 1 box

### DEFINE PHYSICAL PROPERTIES OF ATOMS ###
mass 1 1.0
pair_style lj/cut/opt 3.0
pair_coeff 1 1 1.0 1.0
neighbor 2.0 bin

### SPECIFY THE REQUIRED THERMODYNAMIC STATE ###
variable T equal 2.8
variable timestep equal 0.0025

### ASSIGN ATOMIC VELOCITIES ###
velocity all create ${T} 12345 dist gaussian rot yes mom yes

### SPECIFY ENSEMBLE ###
timestep ${timestep}
fix nve all nve

### THERMODYNAMIC OUTPUT CONTROL ###
thermo_style custom time etotal temp press
thermo 10

### RECORD TRAJECTORY ###
dump traj all custom 1000 output-1 id x y z

### SPECIFY TIMESTEP ###

### RUN SIMULATION TO MELT CRYSTAL ###
run 10000
unfix nve
reset_timestep 0

### BRING SYSTEM TO REQUIRED STATE ###
variable tdamp equal ${timestep}*100
fix nvt all nvt temp ${T} ${T} ${tdamp}
run 10000
reset_timestep 0
unfix nvt
fix nve all nve

### MEASURE SYSTEM STATE ###
thermo_style custom step etotal temp press density atoms vol
variable dens equal density
variable dens2 equal density*density
variable temp equal temp
variable temp2 equal temp*temp
variable press equal press
variable press2 equal press*press
variable N equal atoms
variable N2 equal atoms*atoms
variable etotal equal etotal
variable etotal2 equal etotal*etotal
variable volume equal vol

fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_etotal v_dens2 v_temp2 v_press2 v_etotal2
run 100000

variable avedens equal f_aves[1]
variable avetemp equal f_aves[2]
variable avepress equal f_aves[3]
variable aveetotal equal f_aves[4]
variable aveetotal2 equal f_aves[8]

variable Cv equal ${N2}*(${aveetotal2}-${aveetotal}*${aveetotal})/(${avetemp}*${avetemp})

print "Averages"
print "--------"
print "Density: ${avedens}"
print "Temperature: ${avetemp}"
print "Pressure: ${avepress}" 
print "Heat Capacity: ${Cv}"
print "Total Energy: ${aveetotal}"
print "Total Energy2: ${aveetotal2}"
print "Volume: ${volume}"
print "No of atoms square: ${N2}"

JC: Heat capacity correctly calculated in script.

The temperature and heat capacity at constant volume are generated and shown in Table 2.

Table 2

Density T(T*) Cv/V
0.2 1.97 1.47E-05
0.2 2.17 1.05E-05
0.2 2.39 7.49E-06
0.2 2.65 6.00E-06
0.2 2.76 5.25E-06
0.8 1.99 2.56E-05
0.8 2.17 1.99E-05
0.8 2.36 1.96E-05
0.8 2.65 1.45E-05
0.8 2.79 1.36E-05
File:Figure 9 - A plot showing the heat capacity as a function of temperature at 2 different densities.png
Figure 9 - A plot showing the heat capacity as a function of temperature at 2 different densities

Heat capacity is related to a fluctuation in the canonical ensemble but not ensemble average. It is a physical property measuring how easy it is to excite the system to higher energy state. From a thermodynamics point of view, it is the amount of heat needed to raise the system temperature by one degree in Celsius or Kelvin. As we can see from Figure 9, as temperature increases, heat capacity decreases for both density. The drop is more significant when temperature is raised from 2.2 to 2.4 for ρ = 0.2 and from 2.4 to 2.6 for ρ = 0.8. This is an expected trend for a liquid. As temperature increases, atoms have more kinetic energy and more atoms are populated to higher energy state. The energy levels at higher state have a lower separation and get closer together. There is a higher density of states at higher energy level. Less energy is needed to populate another atom at higher energy level. Therefore the heat capacity at constant volume drops. Also, as mentioned in the paper by Trachenko [2], the decrease of liquid heat capacity as temperature increases is attributed to the increasing loss of two transverse modes with frequency ω<1τ, τ is the liquid relaxation time.

JC: Nice, clear explanation of the effect of temperature on heat capacity. What about the change in heat capacity with density?

Structural properties and the radial distribution function

Radial distribution function is given in (6)

g(r)=ρ(r)ρ(6)

ρ(r) is the local density; ρ is the overall density of atoms

In this section, the radial distribution function (RDF) of solid, liquid and vapour phases of the Lennard-Jones fluid are calculated using VMD.

TASK 19: perform simulations of the Lennard-Jones system in the three phases. When each is complete, download the trajectory and calculate g(r) and g(r)dr. Plot the RDFs for the three systems on the same axes, and attach a copy to your report. Discuss qualitatively the differences between the three RDFs, and what this tells you about the structure of the system in each phase. In the solid case, illustrate which lattice sites the first three peaks correspond to. What is the lattice spacing? What is the coordination number for each of the first three peaks?

Use the literature as a reference to modify the density and temperature parameters in the input script for the RDF. (Table 3) The files are uploaded to the HPC portal and allow it to run. Download the trajectory file after the simulation finished and load it using VMD. The RDF of solid, liquid and vapour are plotted in Figure 10 and the integrals are plotted in Figure 11.

Table 3

Phases Temperature Density
Solid 1 1.2
Liquid 1.2 0.8
Vapour 1.2 0.1
File:Figure 10 - Radial distribution functions of solid, liquid and vapour.png
Figure 10 - Radial distribution functions of solid, liquid and vapour
File:Figure 11 - A plot showing the number of integral over g (r) as a function of distance for solid, liquid and vapour.png
Figure 11 - A plot showing the number of integral over g (r) as a function of distance for solid, liquid and vapour

RDF gives the probability of finding an atom in distance r from another atom (reference atom). It indicates how atoms are radially arranged among each other. A peak shows a favourable distance of separation for the reference atom away from its neighbour. Three common features of RDFs in solid, liquid and vapour are observed. One is all g (r) is equal to 0 below r = 0.825 due to the strong repulsive forces experienced between two positively charged nuclei and the electron clouds. Secondly, g(r) go through a maximum at around r = 1 before they plunge, indicating the chance of finding a pair of atoms at this separation is maximized at r = 1 and decreases afterwards. Thirdly, at longer distances, the g(r) approach one because the overall density is equal to the local density.

Solid has a ordered structure with regular spacing so neighboring atoms can be found at a defined distances as shown by the peaks in Figure 10. Atoms are closely packed so there is a higher chance to find nearest neighbor so there are more peaks observed in solid than liquid and gas.

Unlike solid, liquid has an irregular spacing between atoms and does not have long range order but short range order only. The RDF of liquid appears to be the intermediate form between the RDF of solid and vapour. 4 peaks are seen in the RDF at 4r distances, indicating there are 4 favourable separations for the reference atom. Atoms are packed less closely and there is a lower chance of finding the nearest neighbour than solid. The maximum of g(r) is half of that in solid. For gas, it is a smooth RDF with only 1 peak is seen at r = 1.125, showing gas has the least ordered structure with even more irregular spacing between atoms. The short range order disappears completely. The g(r) is similar to that of liquid.

JC: Graphs look nice and good description of the RDFs and what they show.

File:Figure 12 - Illustration of the first 3 nearest neighbour on a FCC lattice.png
Figure 12 - Illustration of the first 3 nearest neighbours on a FCC lattice

a is the length of the fcc lattice,

The r values for the first three peaks for solid are 1.03, 1.53 and 1.83. They correspond to the 1st, 2nd and 3rd nearest atoms respectively. (Indicated as 1, 2 and 3 in Figure 12)

r=1.03, the distance of the 1st nearest atom is a(12)1/2=1.03

a=1.45

r=1.53, the distance of the 2nd nearest atom is a=1.53

a=1.53

r=1.83, the distance of the 3rd nearest atom is a(32)1/2=1.83

a=1.49

Average lattice spacing, aavg = 1.45+1.53+1.493=1.5.

Figure 13 shows a snapshot of the RDF of the solid with r ranging from 0 to 2. Using this figure, we can find the coordination number for each of the first 3 peaks.

File:Figure illustrating the coordination number = 12 for the first nearest neighbour atom in FCC.png
Figure 14 - Figure illustrating the coordination number = 12 for the first nearest neighbour atom in FCC [6]
File:Fcc first 12 neighbours.png
Figure 15 - Figure illustrating the position of the first 12 neighbours in FCC [5]


File:Figure illustrating the coordination number = 6 for 2nd nearest neighbour atom in FCC.png
Figure 16 - Figure illustrating the coordination number = 6 for 2nd nearest neighbour atom in FCC [6]
File:Figure illustrating the coordination number = 24 for the third nearest neighbour atom in FCC.png
Figure 17 - Figure illustrating the coordination number = 24 for the third nearest neighbour atom in FCC [6]

Coordination number of the 2nd peak = 12 (Figure 14-15)

As we know, fcc is a cubic closed packed structure. There are 6 nearest neighbours in one layer, 3 atoms in the above and 3 in the bottom.

Coordination number of the 2nd peak = 18-12 = 6 (Figure 16)

Coordination number of the 3rd peak = 42 - 18 = 24 (Figure 17)

File:Figure 13 - Figure showing the integral of g (r) of solid from r=0 to r = 2.png
Figure 13 - Figure showing the integral of g (r) of solid from r=0 to r = 2

JC: Good use of pictures to illustrate which atoms contribute to each coordination number.


Dynamical properties and the diffusion coefficient

D=16r2(t)t(7)

TASK 20: In the D subfolder, there is a file liq.in that will run a simulation at specified density and temperature to calculate the mean squared displacement and velocity autocorrelation function of your system. Run one of these simulations for a vapour, liquid, and solid. You have also been given some simulated data from much larger systems (approximately one million atoms). You will need these files later.

Use the density and temperature determined in the early section to modify the input file.

TASK 21: make a plot for each of your simulations (solid, liquid, and gas), showing the mean squared displacement (the "total" MSD) as a function of timestep. Are these as you would expect? Estimate D in each case. Be careful with the units! Repeat this procedure for the MSD data that you were given from the one million atom simulations.

The MSD as a function of timestep for solid, liquid and vapour and the simulated results for one million atoms for each phases are plotted in Figure 18 - 20 respectively. To find the diffusion coefficient, as we know from (7), the diffusion coefficient can be found from the plot of total MSD as a function of time. To convert timestep into time, I multiplied each by 0.002 for all the simulations. The MSD as a function of time for solid, liquid and vapour are plotted in Figure 21 - 23 respectively.

File:Figure 14 - MSD for solid as a function of timestep.png
Figure 18 - MSD for solid as a function of timestep
File:Figure 15 - MSD for liquid as a function of timestep.png
Figure 19 - MSD for liquid as a function of timestep
File:Figure 16 - MSD for vapour as a function of timestep.png
Figure 20 - MSD for vapour as a function of timestep
File:Figure 17 - MSD for solid as a function of time.png
Figure 21 - MSD for solid as a function of time
File:Figure 18 - MSD for liquid as a function of time.png
Figure 22 - MSD for liquid as a function of time
File:Figure 19 - MSD for vapour as a function of time.png
Figure 23 - MSD for vapour as a function of time

Diffusion coefficient, D=16×gradient

Best fit line equations are fitted for all cases. For the solid and vapour case, in order to get a more accurate gradient, the gradient given in the Excel are not taken. I have tried to fit the equation within the linear range for both phases and it in turn gives a significant fluctuation and a best fit line in Excel is not suitable for both cases. Therefore, the gradient of the linear part of the MSD for solid and vapour are measured manually.

JC: This is correct, only the linear part of the MSD should be used for the fit.

Results are shown in Table 4.

Table 4

Phases Gradient of simulated result D (σ^{2}/unit time) Gradient of one million atoms D (σ^{2}/unit time)
Solid 3.00E-05 5.00E-06 3.00E-05 5.00E-06
Liquid 0.509 8.48E-02 0.524 8.73E-02
Vapour 9.10 1.52E+00 15.2 2.53E+00

In MSD, we model the displacement of an atom in a finite volume. As we can see from the graphs, the MSD for solid, liquid and vapour differs significantly within x = 0 to 500. This can be explained by the molecular dynamics through collision between atoms and the force of restoration on each atom to remain in its position in a lattice depending on the phases. For solid phase, the MSD attains a maximum at t = 0.152 and minimum at t = 0.318. Minimum is the point where atoms collide with another atom and lead to a displacement in an opposite direction to its original direction of collision. In MSD model, we cannot anticipate the direction of atoms after collision as the probability of getting both directions are the same. Atoms in solid are closely packed and they cannot diffuse very far from its lattice site. Unlike liquid, the atomic motions in solid are vibratory. There is much less collisions occur in solid compared to liquid and therefore the displacement of solid levels off quickly at around 0.002. This gives solid the lowest number of D.

JC: Particles in solids are fixed to their lattice points so MSD should be horizontal.

File:Figure - A graph showing the linear part of the MSD for solid.png
Figure 24 - A graph showing the linear part of the MSD for solid

Liquid is less closely packed and there are more space between atoms. The atomic motions are Brownian motion like, where atoms can continuously collide with the neighbouring atoms and diffusive behaviour is observed in liquid. As we can see, MSD increases linearly with time. As time proceeds, there is a greater displacement of atoms. This gives a greater D than solid.

For vapour, the atoms are not closely packed and more randomized with a lot of spacing between atoms. After a collision, there is a significant change in displacement. At non zero pressure, the MSD will increase drastically but finitely as time proceeds. There is the greatest diffusive behaviour observed in gas phase and thus gives the highest D among all three phases.

Veolocity autocorrection function (VACF) is shown in (8):

C(τ)=v(t)v(t+τ)(8)

D=130dτv(0)v(τ)

TASK 22: In the theoretical section at the beginning, the equation for the evolution of the position of a 1D harmonic oscillator as a function of time was given. Using this, evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!) Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot C(τ) with ω=1/2π and the VACFs from your liquid and solid simulations. What do the minima in the VACFs for the liquid and solid system represent? Discuss the origin of the differences between the liquid and solid VACFs. The harmonic oscillator VACF is very different to the Lennard Jones solid and liquid. Why is this? Attach a copy of your plot to your writeup.

C(τ)=v(t)v(t+τ)dtv2(t)dt


Position of a classical harmonic oscillator is given by x(t)=Acos(ωt+ϕ)


Differentiate it and we can get the velocity of the atom.


v=dx(t)dt=Aωsin(ωt+ϕ)


Substitute the result obtained into the VACF,


C(τ)=(Aωsin(ωt+ϕ))(Aωsin(ω(t+τ)+ϕ))dt(Aωsin(ωt+ϕ))2dt

A2 and ω2 are cancelled out


C(τ)=sin(ωt+ϕ)sin(ω(t+τ)+ϕ)dtsin2(ωt+ϕ)dt


C(τ)=sin(ωt+ϕ)sin((ωt+ωτ)+ϕ)dtsin2(ωt+ϕ)dt


Using trigonometry identity, we know sin(A+B)=sin(A)cos(B)+cos(A)sin(B)


C(τ)=sin(ωt+ϕ)[sin(ωt+ϕ)cos(ωτ)+cos(ωt+ϕ)sin(ωτ)]dtsin2(ωt+ϕ)dt


C(τ)=sin2(ωt+ϕ)cos(ωτ)dt+sin(ωt+ϕ)cos(ωt+ϕ)sin(wτ)dtsin2(ωt+ϕ)dt


C(τ)=cos(ωτ)sin2(ωt+ϕ)dtsin2(ωt+ϕ)dt+sin(ωτ)sin(ωt+ϕ)cos(ωt+ϕ)dtsin2(ωt+ϕ)dt


sin is an odd function and cosine is an even function. When an odd function is multiplied by an even function, the result is an odd function.


The integral of an odd function with a symmetrical limit becomes 0, so


sin(ωτ)sin(ωt+ϕ)cos(ωt+ϕ)dtsin2(ωt+θ)dt=0


C(τ)=cos(ωτ)

JC: Derivation is correct and justifying each step makes it very clear to follow.


The VACF of solid and liquid and the normalized VACF of 1D harmonic oscillator are plotted in Figure 25.

File:Figure 20 - VACF for solid and liquid and 1D harmonic oscillator.png
Figure 25 - VACF for solid and liquid and 1D harmonic oscillator

For 1D harmonic oscillator, there is a specific velocity at an instant time. There is no collision with other atoms and hence the velocity of the atoms will not change unless it hits the boundary and causes a change in velocity and direction. It results a periodic function as we see in Figure 25. However, atoms can collide with each other in solid, liquid and vapour. Any collision will change the velocity of an atoms. The velocity of the atom before and after collision are different and we say this is decorrelated. As we can see, the VACF decorrelates with time for solid and liquid but in different extent. In solid, there is a fixed regular pattern of atoms arrangement and they cannot move significantly away from their lattice site and collide with another atom. More oscillations are seen in the VACF for solid, indicating there are positive and negative correlations for the velocity as time proceeds before reaching 0. There is a reverse velocity after each oscillation. We can see the magnitude of correlation is different for each turn for solid because there are perturbative forces on atoms in solid to alter the oscillating behaviour. Unlike solid, liquid does not have fixed pattern. We can only see one minimum in the VACF for liquid before it drops to 0. Atoms in liquid can diffuse more and collide with neighbour atoms, which removes the oscillating behaviour we see in solid. The velocity decays rapidly with time. This also explains the value of D we obtain.

TASK 23: Use the trapezium rule to approximate the integral under the velocity autocorrelation function for the solid, liquid, and gas, and use these values to estimate D in each case. You should make a plot of the running integral in each case. Are they as you expect? Repeat this procedure for the VACF data that you were given from the one million atom simulations. What do you think is the largest source of error in your estimates of D from the VACF?

Trapezium rule is given as (10)

y=f(x)

File:Eq 10 - Trapezium rule.png
Eq 10 - Trapezium rule

Using the trapezium rule, the integral for solid, liquid and vapour are obtained and the diffusion coefficients are found by multiplying the integral by frac13.

The corresponding diffusion coefficients are calculated (Table 5)

Table 5

Phases Integral D Integral D
Solid 5.64E-04 1.88E-04 1.37E-04 4.57E-05
Liquid 0.293 0.0977 0.27 0.0901
Vapour 5.23 1.74 9.81 3.27

Table 6 shows a summary of D obtained from VACF and MSD.

Table 6

Phases D obtained from MSD D obtained from MSD (1 million atoms) D obtained from VACF D obtained from VACF (1 million atoms)
Solid 6.05E-06 2.58E-06 1.88E-04 4.57E-05
Liquid 0.0848 0.0873 0.0977 0.0901
Vapour 1.49 2.68 1.74 3.27

The integral and D found are what we expect for each phases. Both VACF and MSD model give the same trend, where vapour gives the largest D, followed by liquid and then solid. This match with the characteristics of each phases. Running integrals match the VACF we get in the previous task. For example, liquid has a single peak and then plateau while solid matches the fluctuations seen in the VACF . The 1 million atom simulation systems give the same trend but different values for both model. As the simulation system size increases, less errors are encountered in the simulation as more atoms are taken into account. In MSD, greater fluctuations are seen in solid for a small system than a large system. The MSD does not effectively level off and becomes constant as time proceeds. Also, the D for vapour calculated from MSD is half of that of one million system for both model.

To calculate D in VACF, we just use trapezium rule is only an approximation of the area under the curve for an integral. The integrals are not exact so this incurs a significant error in VACF. To enhance the accuracy, a smaller timestep can be used. The largest source of error in VACF is we only modify the temperature and density parameters to model a particular phase but not specify the positions of the atoms. Velocity is the only factor we take into account in VACF, which can be significantly affected by the position of the atoms. Position of atoms can vary significantly for each run and the velocity is also affected. For all phases and simulating systems, VACF has larger value than that of MSD. The trapezium rule may overestimate the area under the curve of the integral. Liquid gives the closest overall match between VACF and MSD.

JC: Graphs look good, refer to them directly in the text to help illustrate your points. The position of atoms isn't important as we average over all atoms when we calculate the VACF.

File:Solid running.png
Figure 26 - Figure showing the running integral for solid
File:Solid running one million.png
Figure 27 - Figure showing the running integral for solid with one million atoms
File:Liquid running.png
Figure 28 - Figure showing the running integral for liquid
File:Liquid one million atoms.png
Figure 29 - Figure showing the running integral for liquid with one million atoms
File:Running integral vapour.png
Figure 30 - Figure showing the running integral for vapour
File:Running integral vapour one millon atoms.png
Figure 31 - Figure showing the running integral for vapour with one millon atoms

Reference

[1] JI.Choe and B.Kim, Bull. Korean Chem.Soc. 2000, Vol.21(4) 419 - 424

[2] K. Trachenko, Phys. Rev B, 2008, 78, 104201

[3] D. Fincham, Computer Physics Communications 1986, 40, 263-269

[4] M. Winger, D. Trzesniak, R. Baron, W.F. van Gunsteren, Phys. Chem. Chem. Phys., 2009, 11, 1934-1941

[5] A Brief Note: Why Fcc Has 12 Nearest Neighbours, http://ph.qmul.ac.uk/~anthony/spfm/fcc.html,18 Dec. 2015

JC: Good use of literature.

[6] FCC And Its Neighbours, http://www.ifmpan.poznan.pl/~urbaniak/fcc%20and%20its%20neigbours01.pdf, 18 Dec. 2015.