Jump to content

Talk:Mod:YJJ14

From ChemWiki

JC: General comments: All tasks answered and results look good. Try to expand your written answers more though and use the background theory behind the experiment to explain your results.

Molecular Dynamics: Simulation of Liquids

Velocity Verlet Equation

When applying the Velocity Verlet Equation, it is possible to achieve a good estimate of the positions and velocity of simple liquid particles by varying the timesteps. The following graphs (Figures 1-4) are plotted from data with a timestep of 0.1.

Figure 1: Position varying with time.

Figure 1 shows that the Velocity-Verlet Equation gives a good estimate of the positions when compared to the analytical positions of a harmonic oscillator x(t)=Acos(ωt+ϕ). The coefficients A andΩ are set to 1 and ϕ is set to 0.

Figure 2: Absolute error of between x(t) and analytical positions.

Figure 2 shows the absolute error of positions calculated from the Velocity-Verlet Equation and the positions calculated from a classical harmonic oscillator. Figure 3 shows a linear plot of the maximum absolute errors against time. It can be seen that the error is slowly increasing and should a longer period of time pass, the simulated system will less accurate.

Figure 3: Plot of Maximum Absolute Error in position showing a linear trend.
Figure 4: Total Energy from Velocity-Verlet Algorithm varying with time.

Here the total energy,

Etotal=Ep+Ek

, is calculated using:

Ep=12kx2

and

Ek=12mv2

Where k and m are given as 1. The values x and v are estimated with the Velocity-Verlet Equation. It is important that the fluctuation in error calculated here is small, as the total energy of a real system should not change.


To determine the timestep that is required for the total energy to have less than 1% of fluctuation, trial and error showed that the timestep to achieve small fluctuations in energy in the simulation is 0.2.
This number is large enough so an acceptable amount of time can be run in the simulation, and is small enough so the total energy does not drastically change. It is important that the system simulated is has little change in total energy so the other properties that are measured have a physical significance.

Table 1, shown below, gives a range of timesteps and their associated percentage change in total energy. While Figures 5 to 8 show plots of the fluctuations of total energies for the selected timesteps.

Table 1 - Percentage Changes in Total Energy
Timestep Percentage %
0.05
0.06
0.10
0.25
0.20
1.00
0.25
1.57
Figure 5: Graph showing the fluctuation in total energy with a timestep of 0.05
Figure 6: Graph showing the fluctuation in total energy with a timestep of 0.10
Figure 7: Graph showing the fluctuation in total energy with a timestep of 0.20
Figure 8: Graph showing the fluctuation in total energy with a timestep of 0.25

JC: Why does the error oscillate? Good choice of timestep.

Lennard-Jones Potential

Separation where potential energy is zero

The separation, r0, for a single LJ interaction where the potential energy is zero is:

ϕ(r)=4ϵ(σ12r12σ6r6)=0

(σ12r12σ6r6)=0

σ12r12=σ6r6

σ6r6=1

r0=σ

Force when potential energy is zero

The force, Fi, at the separation r0=σ is given by:

Fi=dU(rN)dri

where

U(rN)=iNijN{4ϵ(σ12rij12σ6rij6)}

Substitute,

Fi=diNijN{4ϵ(σ12rij12σ6rij6)}dri

Differenciate wrt ri

Fi=iNijN{4ϵ(12σ12rij13+6σ6rij7)}

Fi=iNijN{24ϵ(2σ12rij13σ6rij7)}

Because rij=σ when U(rN)=0

Fi=24ϵσ

Equilibrium Separation and well depth

Equilibrium Separation occurs when:

Fi=dU(rN)dri=24ϵ(2σ12r13σ6r7)=0

(2σ12r13σ6r7)=0

2σ12r13=σ6r7

And has a value of:

req=2σ66

With the equilibrium distance, the well depth is found by substituting req into ϕ(r):

ϕ(req)=ϵ

JC: Correct.

Evaluating Integrals

ϕ(r)dr=4ϵ(σ12r12σ6r6)dr

=4ϵ(σ1211r11σ65r5)+C

When σ=ϵ=1.0:

2σϕ(r)dr2.48×102

2.5σϕ(r)dr8.18×103

3σϕ(r)dr3.29×103

JC: Correct.

Periodic Boundary Conditions

Realistic volumes of liquid cannot be simulated, as they involve many more particles than the usual simulated range of 1000 to 10000 particles.

An example is to show the number of water molecules in 1 mL of water under standard conditions.

1mL=1g

Number of moles in 1 mL of water: 1g18gmol1=5.56×102mol

Esimated number of molecules in 1 mL of water: 5.56×102mol×6.022×1023mol1 =3.35×1022

In comparison, the estimated volume of 10000 water molecules under standard conditions.

Estimated volume for 10000 water molecules: 100006.022×1023×18=2.99×1019mL

Because the volume of simulated water is so drastically different, periodic boundary conditions are applied to better approximate a bulk liquid. This is done by pretending the simulation box is repeated infinitely in all directions, so none of the atoms in the box at the edges are exposed to a vacuum.


In a cubic box that runs from (0,0,0) to (1,1,1). An atom at position (0.5,0.5,0.5) runs along the vector (0.7,0.6,0.2). within one timestep it ends up at (0.2,0.1,0.7) after applying periodic boundary conditions.

JC: Correct.

Reduced Units

It is typical when using Lennard-Jones interactions to work in reduced units, so the results are much more manageable. Reduced units are denoted by a star, and they take the following conversion factors:

Distance r*=rσ, Energy E*=Eϵ, Temperature T*=kBTϵ

The Lennard-Jones parameters for argon are σ=0.34nm and ϵ/kB=120K.

If the LJ cutoff is r*=3.2, in real units:
r=r*×σ=3.2×0.34

r=1.088nm


The reduced temperature T*=1.5 in real units:
T=T*×ϵkB=1.5×120

T=180K


The well depth in kJmol1:
ϵ=kBT×NAT*×1000=1.38×1023×180×6.022×10231.5×1000

ϵ=0.998kJmol1

JC: Correct.

Equilibration

Creating the simulation box

When two atoms are given random starting coordinates, there is a probability that they will be generated very close together. This can be problematic as it would cause an infinitely high potential to form. This means that it will be difficult to equilibrate during the timescale of the simulation and so may be unable to provide any useful physical properties.

JC: The high repulsive forces that could be generated make the simulation unstable and can cause it to crash without reducing the timestep.


In a simple cubic cell, if the distance between lattice points is 1.07722, the number density can be calculated as follows:

Number density=Lattice pointsVolume of unit cell

In a simple cubic lattice, there is only 1 lattice point in a unit cell.

Number denisty=11.077223=11.25=0.8


For a face-centred lattice with a lattice point density of 1.2, the length of the unit cell is:

Length of unit cell=Volume of unit cell3

Volume of unit cell=Lattice pointsNumber density

There are 4 lattice points in a face centred cubic cell, therefore:

Length of unit cell=41.23=1.493sf


With a face-centred cubic lattice, create_atoms command would create 4 times as many atoms in a box than when using a simple cubic lattice.

JC: Correct.

Setting the properties of the atoms

The purpose of the following commands in the input script can be found using the LAMMPS manual.

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

This command means that you are defining the mass of the atoms. With a type 1 and with a mass of 1.0 in reduced units

pair_style lj/cut 3.0

This command means that your are simulating paired interactions using a Lennard-Jones potential and cutting off at a distance of 3.0

pair_coeff * * 1.0 1.0

This command defines some of the other coefficients for the simulation. The asterisks correspond to two atoms of any type. The numbers at the end correspond to thecoefficients σ=ϵ=1.0


As we have specified xi(0) and vi(0), the integration algorithm that we can use is the Velocity-Verlet Algorithm as it will update the position each timestep and the velocity each half-step.

JC: Correct, why is a cutoff used with this potential?

Running the simulation

Figure 9 shows two different formats of command that should both run 100000 steps during a simulation.

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

### RUN SIMULATION ###
run ${n_steps}
timestep 0.001
run 100000
Figure 9: Two different formats of command that should achieve the same output.

The command on the left can easily change the number of steps that it will take during a simulation for a certain timestep.

For example, this specific command shows that a timestep of 0.001 would run 100000 steps. If the timestep was changed to 0.01, the code would automatically calculate the number of steps to be 10000. Both timesteps will eventually run for a total time of 100. This cannot be achieved for the command on the right.

JC: Using variables makes it easier to change parameters of the simulation as all commands which depend on those parameters are updated automatically.

Checking Equilibrium

Figure 10: Graph of total energy against time, timestep: 0.001
Figure 11: Graph of temperature against time, timestep: 0.001
Figure 12: Graph of pressure against time, timestep: 0.001

The Figures 10, 11 and 12 show that equilibrium is reached very rapidly.

  • For Total Energy this takes a time of approx: 0.14
  • For Temperature this takes a time of approx: 0.30
  • For Pressure this takes a time of approx: 0.40

Figure 13 shows a graph of all the total energies for all the simulated timesteps, 0.001, 0.0025, 0.0075, 0.01 and 0.015.

Figure 13: Graph of the total energies for the timesteps: 0.001, 0.0025, 0.0075, 0.01 and 0.015.

From these timesteps, it can be seen that the largest timestep that still gives acceptable results is the timestep of 0.01. The worst results occur from the timestep of 0.015, as the total energy simulated from this timestep increases linearly after a short attempt at equilibrating.

However the best timestep to use for future simulations would probably be 0.0025. This timestep achieves the lowest equilibrated energy along with the timestep 0.001. A timestep of 0.0025 would be better because it can simulate for a longer period of time than 0.001, with the best balance.

JC: Good choice of timestep, the average total energy should not depend on the timestep so 0.0075 and 0.01 are not suitable.

Running Simulations Under Specific Conditions

We can change the ensemble of a simulation to measure other properties of a system. In this section the simulations will be run under NpT (isobaric-isothermal) ensembles.

The parameters used in the simulation are two different pressures of 2.5 and 3.0 and temperatures 1.5, 1.7, 1.9, 2.1 and 2.3. All the simulations are run with a timestep of 0.0025, which was the previously determined timestep that gives the best balance between length of simulation and accuracy in results.

Temperature and Pressure Control

To get the target temperature, each velocity will have to by multiplied by the constant factor, γ.

12imivi2=32NkBT

Multiply each velocity by γ:

12imiγ2vi2=32NkB𝔗

Since EK=32NkBT, substituting this into the equation gives:


γ212imivi2=γ232NkBT=32NkB𝔗

This can be simplified and rearranged to:

γ2T=𝔗

γ2=𝔗T

Therefore

γ=±𝔗T

JC: Correct.

Examing the Input Script

### MEASURE SYSTEM STATE ###
thermo_style custom step etotal temp press density
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
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2
run 100000
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2

The three number 100, 1000 and 100000 are the arguments for Nevery, Nrepeat and Nfreq respectively. They determine what timesteps the input values will be used in the average.

Nevery: Number of timesteps between every input number that will be used in the calculation of an average.

Nrepeat: This number refers determines how many input values are averaged. The input values used are the timesteps Nrepeat before the Nfreq.

Nfreq: The multiples of this value of timestep is when averages are calculated.

Ex: For the values Nevery, Nrepeat and Nfreq as 100, 1000 and 100000...

  • When nearing timestep = 100000
  • 100, 200, 300, 400... 5400, 5500, 5600 ... 99700, 99800, 99900, 100000
  • These numbers are 100 timesteps apart from each other. They are the previous 1000 repeats of this timestep which preceded the timestep 100000 when an average is calculated.

This repeats again from 100100 to 200000 where another average of a different set of 1000 values will be calculated.


This then means that in this simulation the values such as temperature will be sampled every 100 timesteps. While for the duration of the 100000 timestep simulation, 1000 measurements will contribute to the average.

Finally the total time that is simulated is: number of steps multiplied by the chosen timestep for the simulation.
100000×0.0025=250

JC: Good.

Plotting the Equations of State

Figure 14 is a plot of density against reduced pressure. As temperature increases, density of the system decreases which in turn suggested that the volume increased when the system increased in energy.

Figure 14: A plot of Density against Reduced Temperature.

Figure 15 is the same plot with additional lines showing the change in density of ideal gases with different pressures when temperature changes.

The simulated density is lower than the density of an ideal gas, suggesting that in an ideal gas the same number of molecules can occupy less space.

This can be explained as ideal gases assume that there are no interactions between particles. This leads to repulsive forces being non-existent in an ideal gas, allowing particles to be closer to each other.

The simulated systems assume Lennard Jones potentials and when particles become too close to each other, the potential energy increases and they will be pushed apart to occupy a higher volume and lower density.

This discrepancy increases with increased pressure as the difference in densities is larger for the system with a pressure of 3.0 than 2.5.

JC: Why does the discrepancy increase with pressure and decrease with temperature? When is the ideal gas approximation best?

Figure 15: A Density-Temperature Plot with the predicted densities of an ideal gas at the same pressures.

Calculating Heat Capacities Using Statistical Physics

In this section a NVT ensemble was simulated to calculate the heat capacity.

Figure 16 shows a plot of heat capacity at a constant volume over volume. It is showing the variation in energy as temperature changes.

Figure 16: Plot of Cv/V against reduced temperature for two different densities.

The trend shown is expected. As by increasing the energy of a system by increasing temperature, the systems total capacity for heat decreases. Higher densities allow higher heat capacity/volume because there is a lower volume and hence a higher value of heat capacity.

JC: Can you add a bit more detail to this explanation? Why do you expect the heat capacity to decrease with temperature? The heat capacity is higher at higher densities because there are more particles per unit volume and hence more energy is required to raise the temperature. What function have you used to fit the heat capacity data to and why?

### SET DENSITY OF LATTICE ###
variable density equal 0.2


### DEFINE SIMULATION BOX GEOMETRY ###
lattice sc ${density}
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.0
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
unfix nvt
fix nve all nve
reset_timestep 0

### MEASURE SYSTEM STATE ###
thermo_style custom step etotal temp atoms vol
variable energy equal etotal
variable energy2 equal etotal*etotal
variable temp equal temp
variable temp2 equal temp*temp
variable n equal atoms
variable n2 equal atoms*atoms
variable vol equal vol
fix aves all ave/time 100 1000 100000 v_energy v_energy2 v_temp v_temp2
run 100000

variable ave_energy equal f_aves[1]
variable ave_energy2 equal f_aves[2]
variable ave_temp equal f_aves[3]
variable ave_temp2 equal f_aves[4]
variable cv equal ${n2}*(${ave_energy2}-${ave_energy}*${ave_energy})/(${ave_temp}*${ave_temp})
variable cv_v equal ${cv}/${vol}


print “Variables"
print "Temperature: ${ave_temp}"
print "Cv: ${cv}"
print "Cv/V : ${cv_v}"

Structural Properties and the Radial Distribution Function

Simulations of Lennard-Jones potentials for the three different phases solid, liquid and a gas were performed. The g(r) and g(r)dr were plotted against distance and are shown in Figure 17 and 18.

Figure 17: RDF of a solid, liquid and gas.
Figure 18: RDF of a solid, liquid and gas.

The radial distribution function, g(r) shows the probability of finding another atom as a function of distance from a reference atom. In particular the probability of finding a particle on the surface of a sphere as the radius increases.

In all three systems, the RDF initially shows a value of zero before a sharp increase just before r=1. The RDF is zero here because the region is the van der Waals radii of the reference particle. If the probability of finding other particles in this range was larger than 0 then the potential energy of the system would dramatically increase and become very unfavoured because of strong repulsive forces.

In a gas, the probability of finding other particles quickly averages out as the particles in a gas can easily diffuse. So the probability of find more gas particles quickly becomes the same throughout the system. This is very similar to a liquid, though there is a slight increase in organisation of particles immediately surrounding the reference particle.

In solids the RDF shows discrete peaks as you increase the distance from the reference particle. This shows that the structure of a solid is very organised and a particular unit cell of atoms can be repeated periodically in three dimensions of a lattice.

The first three peaks in the RDF for a solid correspond to the first three nearest neighbours in the lattice. This is shown in Figure 19 where some of the nearest neighbour relationships are labelled.

Figure 19: FCC lattice, showing the 1st, 2nd and 3rd nearest neighbours.

The lattice spacing in the solid system is the distance between the reference atom and the 2nd nearest neighbour.
For a simulation where the density of the system is 1.5 with a temperature of 1.2: the lattice spacing a is 1.375.

The coordination number of the first three peaks are:

  • 12 for the first peak and the first nearest neighbour.
  • 6 for the second peak and the second nearest neighbour.
  • 24 for the third peak and the third nearest neighbour.

JC: The RDF shows that liquids have short ranged order, but solids have long range order. How did you get the coordination numbers for the first 3 peaks? How does the value of the lattice parameter calculated from the RDF compare with the value of the lattice that you set up initially in your simulation? You could have calculated the lattice parameter from the first and third peaks as well using the geometry of the fcc lattice and then taken an average.

Dynamical Properties and the Diffusion Coefficient

Mean Squared Displacement

The mean squared displacement is a measure of the deviation time between the position of a particle and some reference position.

Figure 20 shows a plot of the total mean squared displacement against timestep for the three different phases: a vapour phase, a liquid phase and a solid phase.
It can be seen that displacement occurs significantly faster for the vapour phase than the liquid or solid phases.

Since the mean squared displacement by time, r2(t)t has already been plotted. The diffusion coefficient can be estimated by extrapolating the linear regions of each line and dividing through by 6 because: D=16r2(t)t.

The values of D are shown in Table 2 below. As expected a vapour phase has the largest diffusion coefficient and is significantly large than the diffusion coefficients for liquid and solid phases.

Figure 20: A plot of total mean squared displacement against timestep
Figure 21: A plot of total mean squared displacement against timestep for a simulation of one million atoms.
Table 2 - Values of D for the two simulations of mean squared displacement against time
Phase D (Area/time) - MSD D (Area/time) - MSD (million atoms)
Vapour 6.05 3.18
Liquid 8.49 x 10-2 8.72 x 10-2
Solid 7.20 x 10-7 4.39 x 10-6

JC: Plot the MSDs for different phases on different graphs as it is difficult to see the shape of the solid and liquid MSD from your plots. Why is the gas MSD curved initially (ballistic regime) before becoming linear.

Velocity Autocorrelation Function

The Velocity Autocorrelation Function is:
C(τ)=v(t)v(t+τ)


Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator.

A 1D harmonic oscillator:

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

Substitute into the equation for a normalised velocity autocorrelation function: C(τ)=v(t)v(t+τ)dtv2(t)dt

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

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

C(τ)=A2ω2sin(ωt+ϕ)×sin(ωt+ωτ+ϕ)dtA2ω2sin2(ωt+ϕ)dt

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


Using double angle formula: sin(α±β)=sinαcosβ±cosαsinβ

sin(ωt+ϕ+ωτ)=sin(ωt+ϕ)cosωτ+cos(ωt+ϕ)sinωτ


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

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

The constants cosωτ and sinωτ can be moved to the front.

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

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

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

From here, evaluate the integrals as odd and even functions.

As sin(x)cos(x) is an odd function, and integrating an odd function between equal limits = 0.
The numerator on the right hand side becomes 0,

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

C(τ)=cosωτ+0

C(τ)=cosωτ

JC: Good, clear derivation.


Plotting the VACF for different simulations

Figure 22, shows a plot of the VACF for a liquid and a solid and a harmonic oscillator. If there was no interactions in the system, the atoms would retain their velocities and the plot would show a graph with a horizontal line. However the presence of attractive and repulsive forces between atoms cause them to loose their initial energy and initial velocity.

The minima of the VACFs for the liquid and solid represent the maximum velocities of the atoms when they are travelling in opposite directions to their initial velocities.

The VACF for the liquid has an initial higher velocity because it is at a higher energy system than the solid. However it looses this velocity more rapidly than the solid because of the increased probability in collisions in a more diffusive system. Whereas in the solid, the velocities can much more easily pass back and forth between atoms because how orderly the atoms are arranged in a solid. This leads to a longer period of time where there is a significant oscillation in the velocity of the solid before averaging out like the liquid.

The difference in the VACF for the harmonic oscillator is mainly due to the fact that a harmonic oscillator observes the conservation of energy during an oscillation. This results in a wave where the maxima and minima of the curve have equal amplitudes. In the Lennard Jones liquid and solid, there are atomic interactions that will interfere with this energy conservation and the velocity averages out.

Figure 22: Plot of cos(ωτ), and the VACF for a Lennard Jones liquid and a solid.

JC: The decorrelation of the VACF is not because of lack of conservation of energy, but is caused by collisions between particles which randomise the velocities of the particles. There are no collisions in the harmonic oscillator.

Estimating D from VACF

As the diffusion coefficient can also be estimated by this equation: D=130dτv(0)v(τ)

It can be seen that value is one third of the previously calculated integral for the Velocity Autocorrelation Function.

Figures 23-26 are the running integrals of the VACF for the three phases, calculated with the trapezium rule.

Figure 23: Integration of the VACF for a vapour, liquid and solid.
Figure 24: Integration of the VACF for a liquid and solid.
Figure 25: Integration of 1 million atoms of the VACF for a vapour, liquid and solid.
Figure 26: Integration of 1 million atoms of the VACF for a liquid and solid.

The final value of the integral for the vapour, liquid and solid shown in Figures 23-26 divided by three is a good estimate for the diffusion coefficient.

Table 3 shows the diffusion coefficients calculated from the VACF.

Table 3 - Values of D for the two simulations of VACF
Phase D (Area/time) - VACF D (Area/time) - VACF (million atoms)
Vapour 6.34 3.27
Liquid 8.49 x 10-2 9.01 x 10-2
Solid 1.14 x 10-5 4.55 x 10-5

If you compare these values of the diffusion coefficients calculated from a VACF to the values of diffusion coefficients calculated from the mean squared displacement, you can see that the values agree with each other rather well. The values of D also are expected, as the diffusion coefficient is largest for the vapour phase and lowest for the solid phase. As diffusion is easiest in a gas and much harder in a rigid solid structure.

The largest error for the estimates of D is probably from the estimation of the integral. The trapezium method tends to overestimate in its calculation of the area under the curve and so the values of the diffusion coefficient using the VACF are larger than the values of D calculated from the MSD.

JC: To calculate the diffusion coefficient from the integral of the VACF we replace the upper limit of the integral by the length of the simulation and this is only valid if the integral has converged by this time, which may be another source of error.