Jump to content

Talk:Mod:tonyyang

From ChemWiki

Comments in red

Introduction

In this experiment, computational molecular dynamic methods involving Velocity-Verlet algorithm and Lennard-Jones potentials were used to model a mono-atomic system. Some of the thermodynamics data was calculated from simulations by using statistical thermodynamics.

Theory

A plot of ERROR against time. The maxima are picked and fitted to a straight line.

In the plot of error against time, the error appears to be oscillating periodically with time. This is because the Velocity-Verlot algorithm assumed constant velocity within each timestep. This is generally a good enough assumption, however, the error will increase when the simple harmonic oscillator is at its maximum acceleration. Therefore, the maxima in error appear periodically (the period is π). Tick



A plot of energy against time at timestep=0.28.

A plot of energy against time at timestep=0.28. The maximum deviation from the average energy does not exceed 1%.

The algorithm used to is not a perfect description for the energy of the system. So if the energy deviates too much from reality then this algorithm is not good enough for the simulation. Although small timestep can produce a better result, the simulation will also take longer. So a good balance between accuracy and time is needed. Tick, could also mention how errors accumulate




For r0=σ, potential energy ϕ(r0)=4ϵ(σ12r012σ6r06)=4ϵ(11)=0.

And the force:

F(r)=dU(r)dr=d(4ϵ(σ12r12σ6r6))dr=4ϵ(12σ12r13(6)σ6r7)=24ϵ(2σ12r13+σ6r7)(1)

When r=σ, F(r)=24ϵ(21r+1r)=24ϵr. Good




At equilibrium separation, req, force is zero,

F(req)=24ϵ(2σ12req13+σ6req7)=0σ6req7=2σ12req13req6=2σ6req=216σ

At this separation, the well depth,

ϕ(req)=4ϵ(σ124σ12σ62σ6)=4ϵ(1412)=ϵ



ϕ(r)dr=4ϵ(σ12r12σ6r6)dr=4ϵ(111σ12r11+15σ6r5)

When σ=ϵ=1.0, the integral becomes,

ϕ(r)dr=411r11+45r5,

therefore,

2σϕ(r)dr=(41111+455)(411×211+45×25)=0.0248

and similarly,

2.5σϕ(r)dr=0.00818

3.0σϕ(r)dr=0.00329.

As can be seen here, the integral of energy after 3.0σ is sufficiently small. So it is safe to make 3.0σ the cut-off point. Correct




Number of water molecules in 1mL of water = massmolarmass×NA=1g18g/mol×6.022×1023mol1=3.35×1022

Volume of 10000 water molecules =10000NA×molarmassdensity=10006.022×1023×18g/mol1g/cm3=2.99×1019cm3 Tick




(0.5, 0.5, 0.5) + (0.7, 0.6, 0.2) = (1.2, 1.1, 0.7)

But because of the periodic conditions, the atom re-enters the cube one it leaves the cube. So, once its coordinate exceed 1, that coordinate will be reset to 0, ie. co-ordinates modulo 1.

So, the atom ends on (0.2, 0.1, 0.7).




r in real unit:

r=r*×σ=3.2×0.34×109m=1.09×109m

Well depth in real unit:

ϵ=120K×1.38×1023J/K×6.022×1023=997J/mol=0.997kJ/mol

T in real unit: T=T*ϵkB=1.5×120K=150K

Equilibration

When two atoms are close together, they repel each other very strongly and the inter-atomic energy will rise rapidly. By randomly assign coordinates to atoms, the system's internal energy could get unrealistically high and impossible to maintain the required conditions for a certain ensemble.




Simple cubic lattice, 1 lattice point per unit cell.

Numberdensity=latticepointperunitcellvolumeofunitcell=11.077223=0.800

Face-centred cubic lattice has 4 lattice points per unit cell.

Unitcellvolume=latticepointperunitcellNumberdensity=41.2=103

Sidelength=volume13=1033=1.494 Tick




Since 1000 unit cells are created and each face-centred cubic lattice has 4 lattice points per unit cell then 4x1000=4000 atoms will be created.




mass 1 1.0

Mass command.

There is 1 type of atom and the atomic mass is 1.0 (in reduced unit).

pair_style lj/cut 3.0

Pair_style command.

lj/cut means the standard 12/6 Lennard-Jones potential with no Coulombic pairwise interaction is used.

3.0 denotes the cut-off for Lennard-Jones potential is 3.0σ but what is the cut-off?

pair_coeff * * 1.0 1.0

Pair_coeff command. This is used to specify the atoms' interaction coefficient.

Because there is only one type of atom used, so the two asterisks set the force field coefficients for all atom pairs to be the same. The two 1.0 arguments mean that no special treatment is taken and the potential energy follows Lennard-Jones potential explicitly.



The initial coordinates and velocities are specified so the Velocity-Verlet algorithm can be used.Tick




These lines make the simulation run for a constant time (T*=100) plus 100000 steps no matter what the timestep is. Using timestep as a variable means that the timestep for the simulation can be easily modified and the total number of steps needed for T*=100 is calculated automatically.Tick




Plots of energy, temperature and pressure against time for 0.001 timestep are shown above. It can be seen that all the graphs reached equilibrium quickly at around T*=0.4 (the whole simulation ran for T*=100+ but the first T*=5 plots are shown here).Tick


A plot of energies at different timesteps against time.

From this plot, the energy simulation of 0.015 timestep did not converge which means 0.015 is too big for this simulation (bad choice). The other four timesteps all reached equilibrium. However, due to the relative large timesteps, timestep 0.01 and 0.0075 have higher average energy when equilibrium is reached. This is caused by the larger error in energy which results in a higher deviation from lowest energy. The 0.0025 and 0.001 timesteps have almost identical plots with less fluctuation than the other three plots which means they are both reliable timesteps. Therefore, 0.0025 is a good balance between time and accuracy (largest timestep to give acceptable results). Good


Running simulations under specific conditions

EK=32NkBT

12imivi2=32NkBT(2)

By imposing the desired tempreture, each velocity needs to be multiplied by coefficient γ,

12imi(γvi)2=32NkB𝔗

γ212imivi2=32NkB𝔗(3)

divide (3) by (2) to get,

γ2=𝔗T

γ=𝔗T Tick




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

Fix ave/time command. The numbers 100, 1000 and 100000 denote that the average values are calculated every 100000 timesteps, the previous 1000 values, each 100 timesteps away, are used to calculate the average. For example, the values at timesteps 200100, 200200, 200300, ..., 300000 (1000 values in total) are used to calculate the average value on timestep 300000. Tick



A plot of simulated densities and ideal gas densities at different pressure against temperature.

As can be seen from this plot, both the simulated data and data from ideal gas law show a decrease in pressure when temperature increases in this NpT ensemble. NpT system tries to keep the pressure and temperature constant throughout the simulation. At higher temperature, the atoms have larger kinetic energy so higher repulsion between atoms is expected (higher pressure). In order to keep pressure constant while increasing temperature, the density must decrease which agrees with the trend in this plot.

The calculated ideal gas densities are higher than the simulated data at the same pressure. One of the fundamental approximation in ideal gas law is that particles do not interaction with each other, which means the atoms can get much closer, results in a higher density. The discrepancy increases with pressure. At higher pressure, the atoms repel each other more strongly while ideal gas law still treat the atoms the same. So a large discrepancy is expected. Good explanation


Calculating heat capacities using statistical physics

CV=Var[E]kBT2=N2ϵ2Var[E*]kBϵ2kB2T*2=N2kBVar[E*]T*2

Therefore, the heat capacity of the simulations can be calculated from its outputs. But the simulation boxes at different densities have different sizes. So it is more sensible to calculate the volumetric heat capacity (CVV)and compare.

CVV=N2σ3VkBVar[E*]T*2

The volumetric heat capacites at different temperature and densities are calculated and plotted below.

A plot of simulated volumetric heat capacity at different densities against temperature.

As can be seen from this plot, the volumetric heat capacities do not vary much when the temperature changes at each density. This is expected for a monoatomic system when there is no phase change.

The heat capacity increases when the density is increased, this is expected because there is more substance that can absorb thermal energy per volume.

An example input file can be found here. These heat capacity values look a little large. Heat capacity should decrease with increasing temperature for a monatomic crystal - think about the density of states and how it changes for larger temperatures


Structural properties and the radial distribution function

The radial distribution function (RDF) can be generated from the trajectory file and it illustrates the local environment in a particular structure.

A plot of g(r) of vapour, liquid and solid against r*.

As shown in this plot, the three phases have a very similar first peak at around r* = 1.1 which is close to the req calculated before. After the first peak, the vapour's g(r) immediately converges to 1; the liquid's g(r) fluctuates slightly then converges to 1; the solid's g(r) has a much greater fluctuation than the other two phases, then the fluctuation decreases but does not converge.

This shows that the gas has the most random distribution of atoms, ie. after the first peak caused by particle repulsions, the distribution of atoms around the centre appears to be uniform. The solid, on the other hand, shows a more structured distribution. This is expected as solid has the least degree of freedom and less subjected to random thermal motion. And the liquid's RDF shows a structure between vapour and solid. True but think about long range order




A plot of integral of g(r) of solid against r*.

The first three peaks are picked from the integral of g(r).

A fcc lattice.

The three closest neighbours in the fcc lattice are labelled in the figure. The difference in the g(r) integral peaks indicates the number of new lattice sites. The results are summarised below.


RDF results
Peak index (atom index) Distance of lattice site from origin (lattice spacing) coordination number
1 22 12
2 1 6
3 62 24

Since the second peak corresponds to the atom exactly 1 lattice spacing from the centre, lattice spacing = 1.53 (in reduced unit). So the lattice spacing is 5.21 Å. What's the coordination number for the solid?

Dynamical properties and the diffusion coefficient

D=16r2(t)t=16σ2r*2(t)σ(m/ϵ)1/2t*

In order to find the diffusion coefficient, the mean square displacement of the system is monitored and plotted against T*. Best fit lines of the linear region are plotted as well and the gradients are found.

From the gradients, the diffusion coefficients can be found as below.

Diffusion coefficient (m2s1)
Small system One million particles
Vapour 1.88692×1007 1.67138×1007
Liquid 4.52269×1009 4.64877×1009
Solid 0 0

The diffusion coefficients calculated from small system and large system have very close values. It can be seen that vapour has the largest diffusion coefficient and liquid diffuses slower than gas which is expected. Solid almost does not diffuse which is also expected.


Velocity Autocorrelation Function

The velocity of a 1-D harmonic oscillator is given by v(t)=ωAsin(ωt+ϕ),

and substitute this equation into the velocity autocorrelation function (VACF),

C(τ)=v(t)v(t+τ)dtv2(t)dtC(τ)=ω2A2sin(ωt+ϕ)sin(ωt+ωτ+ϕ)dtω2A2sin2(ωt+ϕ)dtC(τ)=sin(ωt+ϕ)sin(ωt+ωτ+ϕ)dtsin2(ωt+ϕ)dt

By using angles addition formula,

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

As sin(ωt+ϕ)cos(ωt+ϕ) is an odd function, sin(ωt+ϕ)cos(ωt+ϕ))dt=0

C(τ)=cos(ωτ)sin2(ωt+ϕ)dtsin2(ωt+ϕ)dtC(τ)=cos(ωτ) Good


A plot of VACF against timestep for harmonic oscilator, simulated liquid and solid.


Minima in VACF of liquid and solid are the constant velocity points for the particles because the velocity correlation at that point does not change which means the velocity remains constant. Same as before, the liquid VACF decreases rapidly then converges to zero with only one minimum point. The solid VACF has several peaks before it converges to zero. This means liquid reaches random motion much quicker than solid which is expected as liquid is more flowable. In Velocity-Verlet algorithm and Lennard-Jones potential, the harmonic oscillator's velocity and position depend on its previous velocity. While in VACF, the velocity correlation with previous velocity is the subject of study. Good explanation


The plots with a larger system show smoother lines because of more particles are taken into the average. In particular, the integral of solid's VACF is almost 0. This can be explained by considering the solid structure of the fcc lattice. In the lattice, the atoms tend to vibrate in all directions rather than moving around, so the integral averages to nearly zero. As expected, the liquid's integral also converged much quicker than the vapour's integral and the vapour's integral may not fully converged yet.

The calculated diffusion coefficients are listed below.

Diffusion coefficient (m2s1)
Small system One million particles
Vapour 2.06768×1007 1.74825×1007
Liquid 5.23594×1009 4.81884×1009
Solid 0 0

These diffusion coefficients are similar to the previously calculated values from MSD. The largest source of error can be the simulation data. As can be seen in some of the figures, the simulation should be run long to ensure the value converges. When comparing to the provided data, the larger system shows less random fluctuation. So a larger system and longer simulation long will reduce error in this calculation. Good explanation