Rep:Y3C Liquid Simulation:hjt14
Section 1: Running First Simulation
No task.
Section 2: Introduction to Molecular Dynamics Simulation
Numerical Integration
Task
Link to the completed HO.xls file. The followings are the graph constructed using data from the excel worksheet. The first graph is an overlap of two graph of position of simple harmonic oscillator, , as a function of time, ; one calculated using velocity verlet algorithm, and one calculated using . The second graph is the graph of total energy of the simple harmonic oscillator, , as a function of time, . The third graph is the graph of absolute error (difference between in position, , calculated using classical harmonic oscillator solution and calculated using velocity verlet algorithm) as a function of time, . The maximas were located from each parabola and were fitted with a linear function. The equation of the linear function is displayed on the graph.
Graphs from excel file |
---|
Since we are working in a close system, i.e., no energy exchange with surrounding, the total energy of the system should be a constant. What we observed from graph 2 is that the total energy of the system oscillates about an average value. The deviation from the average energy is treated as the error introduced by the approximation we made in velocity verlet algorithm. The percentage error of total energy at different timestep were computed using following equation and the results are summarized in graph 4:
Percentage Error
It can be seen from graph 4 that for timestep beyond 0.28, the percentage error in total energy will exceed 1%.
Atomic Forces
Task
Lennard-Jones Equation:
When potential energy is set to zero, i.e.:
The value of when potential energy is set to zero,, is equal to .
The force acting on a particle a distance away from another particle can be calculated using following equation:
When :
At distance , where the potential energy, , is zero, the force acting on a particle is equal to .
When , defines :
The equilibrium distance, , between 2 particles, which is defined as separation of 2 particles when the force acting on each particle is zero, is equal to , is a constant and is specific to particle under study. At equalibrium distance, , the potential energy, , is at minimum and can be caculated as follow:
The following part shows the working of the integration of potential energy, , with respect to . The integral is equivalent to the area under the potential energy graph encompassed by the integration range, to .
When and :
When and : | When and : | When and : |
|
|
|
Periodic Boundary Conditions
Task
The number of water molecules in 1 ml of water under standard conditions (298K and 1 atm) is calculated as follow:
Density of water under standard conditions
Mass of 1 ml of water
Molar mass of water
Number of water molecule in 1 ml of water
The volume occupied by 1000 water molecules under standard conditions is calculated as follow:
Mass of 1000 water molecules
Volume occupied by 1000 water molecules
Task
Under periodic boundary condition, the final position of an atom, after it move from by in a cubic simulation box which runs from to , can be calculated as follow:
New position of atom
Apply periodic boundary condition:
New position of atom
Reduced Units
Task
The real units, , is calculated as follow: | The well depth in is calculated as follow: | The reduced temperature in real units is calculated as follow: |
and
|
|
|
Section 3: Equilibration
Creating the Simulation Box
Task
Within an input file for molecular simulation, the initial conditions stipulated may not be the equilibrium conditions. During a simulation, LAMMPS will try to bring the system down to the equilibrium state by iteration within the allowed timesteps specified in the input file. If random coordinate is assigned to each atom, there is a chance that two or more atoms will be assigned coordinates that are too close together. This will mean that the atoms overlap in space. According to Lennard-Jones equation, this condition will give rise to the extremely high potential energy (approach infinity) and large repulsion between atoms. As a result of this situation, calculations done using LAMMPS sumulator will run into errors and the system will not be brought to equilibrium state.
Task
A unit cell of a simple cubic lattice is a cube dotted with lattice point at each vertice. Each vertice is shared between 4 unit cells, hence each vertice will contribute a quarter of a lattice point to a unit cell. Consequently, each unit cell will have lattice point, 4 corners each contributes a quarter of a lattice point. The number density can be calculated by dividing the number of lattice point in a unit cell by the volume of a unit cell.
If we have a unit cell of size (in redued units):
Number density of a simple cubic lattice
If we have a face-centered cubic lattice with lattice point number density of , we can calculate the size of unit cell as follow:
Number of lattice point in a face-centered cubic unit cell
Volume of unit cell
The lattice parameter of a face-centered cubic lattice with lattice point number density of is (in reduced units).
Task
The number of unit cell created in the defined region is . In each face-centered cubic unit cell, atoms will be generated. Consequently, the total number of atom that will be generated if a face-centered cubic lattice is used instead of a simple cubic lattice is .
Setting the Properties of the Atoms
Task
mass 1 1.0 pair_style lj/cut 3.0 pair_coeff * * 1.0 1.0 |
The first line of the command set the mass of the atom of type 1 to 1.0 (reduced units). The second line of the command defines the equation used to model the pairwise interaction energy between atoms. In this example, we are using Lennard-Jones Equation with a cutoff distance of 3.0 (reduced units). The third line of the command defines the coefficients of Lennard-Jones Equation, i.e . The asterisks (* *) mean that the Lennard-Jones model will be imposed on every pair of atoms.
Task
Given that we are specifying and , the integration algorithm that we will be using is velocity verlet algorithm.
Running the Simulation
Task
### 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
By assigning a variable (timestep) to timestep (the value), it allows us to call 'timestep' at other part of the input script, meaning that we do not have to retype the exact value of timestep repeatly and allow us to call it simply by typing ${timestep}. Another advantage of assigning a variable (timestep) to timestep (the value), is that if we need to change the timestep of a simulation, we only need to change the value assigned to the variable 'timestep' and timestep in other part of the input file will be updated accordingly.
Checking Equilibrium
Task
![]() |
![]() |
![]() |
Above show three graphs obtained from LAMMPS simulation ran at 0.001 timestep. It can be seen that the system did achieved equilibrium and the inset in each graph show that system achieve equilibrium in approximately 0.4 fs. LAMMPS simulations were also ran at other timestep and the results for total energy were summarised in graph 8.

From graph 8, it can be seen that the most suitable timestep is 0.0025 as it is the maximum value which still allow the system under study to achieve equilibrium (a compromise between accuracy and time). 0.015 is a particularly bad choice because the system simulated at that timestep did not converge.
Section 4: Running Simulations under Specific Conditions
Thermostats and Barostats
Task
In order to bring the system to target temperature, , we multiply the velocity of each particle with a constant factor, , which will help to modulate the velocity of each atoms. The factor,, can be derived as follow:
Let and multiply velocity of each atom with a constant factor,
Examining the Input Script
Task
fix aves all ave/time 100 1000 100000 v_dens v_temp v_press v_dens2 v_temp2 v_press2
The numbers and its position in the series will affect how the averages are calculated. The roles that each number play are summarised as follow:
Position | Value | Role |
---|---|---|
First | 100 | Sample data every 100 timestep |
Second | 1000 | Perform sampling 1000 times |
Third | 100000 | Average all the sampled data collected within 100000 timestep |
Plotting the Equations of State
Task
Conditions used | Graph | |
---|---|---|
Pressure | Temperature | |
2.0 | 1.8 | ![]() |
2.0 | ||
2.2 | ||
2.4 | ||
2.6 | ||
3.0 | 1.8 | |
2.0 | ||
2.2 | ||
2.4 | ||
2.6 |
Shown in the table, are 10 phase points used in LAMMPS molecular dynamic simulation to compute density under these conditions. The theoretical value of density at these phase points were also calculated using reduced ideal gas equation. The simulated density and calculated density are summarised in graph 9. The reduced ideal gas equation used in calculation is shown below:
In graph 9, it can be seen that:
a) at all temperature, the simulated density are lower than the theoretical density.
Explanation: In ideal gas, we assume there are no inter-molecular interactions between particles, i.e., no attraction and no repulsion. However, in our LAMMPS simulation, we model the inter-molecular interactions using Lennord-Jones equation and this breaks the fundamental assumption made in the derivation of ideal gas equation. According to Lennard-Jones equation, below a certain bond distance, a particles pair will experience repulsive forces which will keep them at a distance away from each other. In this case, the particles are further apart from each other than they would be if they behave ideally. Consequently, the number of particle per unit volume, which is the density, is lowered.
b) the simulated density deviate considerably from ideal behavior at low temperature. At higher temperature, the magnitude of deviation decreases and the theoretical density and simulated density start to converge to a single value.
Explanation: At low temperature, the thermal energy, , is small relative to the interaction energy. Therefore the interaction energy can not be neglected and contribute significantly to the thermodynamic properties of our system. As temperature starts to increase, the thermal energy increases and at one point the magnitude of the thermal energy will become comparable to the interaction energy. At that point, the interactions between particles can be easily perturbed by thermal fluctuation and hence become irrelevant in determining the thermodynamic properties of our system. In other words, at higher temperature, interactions between particles become insignificant and system approaches ideal behavior. Therefore, simulated density and theoretical density converge to a single value.
Section 5: Calculating Heat Capacities Using Statistical Physics
Task
Link to one of the input file.
Conditions used | Graph | |
---|---|---|
Density | Temperature | |
0.2 | 2.0 | ![]() |
2.2 | ||
2.4 | ||
2.6 | ||
2.8 | ||
0.8 | 2.0 | |
2.2 | ||
2.4 | ||
2.6 | ||
2.8 |
Pressure is defined as , at higher pressure there will be more particle per unit volume. In section 4, we encounter following equation which correlates the instantaneous temperature of a system to total kinetic energy:
Occupying the same volume, a system at higher pressure will have a greater number of particles. Therefore, for the same increment in temperature, the energy we need to provide to a system at higher density is greater than that of a system at lower pressure simply because there are more particles to which we have to provide the energy. Consequently, the heat capacity per unit volume of a system at higher pressure is greater than that of system at lower pressure simply because we need to provide more energy for the same increment in temperature.
According to equipartition theorem, each degree of freedom of an atom will contribute to the total heat capacity of the system. As we are modeling a constant number of atoms, we expect the heat capacity of the system to be a constant. For both graphs, there is no clear reason to why the heat capacity reduces with temperature. One possible reason is that the density of state decreases with temperature. Higher density of state means that the energy levels are closer together and are easy to populate the energy states and hence correlate to lower heat capacity; Lower density of state means that the energy gap between energy levels is larger and and are difficult to populate the energy states. For same increment in temperature, greater energy need to be provided, and hence this correlate to higher heat capacity. One way to verify this is to obtain a plot of density of state versus energy.
Section 6: Structural Properties and the Radial Distribution Function
Calculating in VMD
Task
can be understood as the number of particle per unit volume of shell of size divided by the bulk density.
Section 7: Dynamic Properties and the Diffusion Coefficient
Mean Squared Displacement
Task
From graph 13, it can be seen that the diffusion coefficients increase from solid to gas and these are expected. In solid, the particles are closely packed, to diffuse, solid particles have to overcome large repulsion when sliding pass other particles and this contribute to the large activation energy for diffusive motion. Hence solid has negligible diffusion coefficient due to large energy barrier. From liquid to gas, the packing decreases meaning that the particles are further apart, making it easier for particle to move pass each other. The is reflected in the increase in diffusion coefficient when going from liquid to gas.
Velocity Autocorrelation Function
Task
The second term goes to zero and then we are left with:
Task
![]() |
![]() |
Equation shown above projects velocity at onto velocity at and what we obtain is , a number which quantifies the correlation between the two velocities. From gas to solid, the rate of decay of increases and this is related to the rate of collision. In gas and liquid, particles collide with one another, however, in liquid, the frequency of collision is higher. Rapid exchange of energy between liquid particle causes a liquid particle to lost the initial velocity component at a faster rate than that of gas. From liquid to solid, the situation changes slightly. In a solid, unlike gas and liquid, the particles only vibrate about the equilibrium position. Because the motion of solid particle is confined within a small space, it correlate to initial velocity to a longer period of time. The minima in solid and liquid VACF vs time graph (see Graph 15 and Graph 16) is related to back scattering of particle after collision, hence the is negative in sign (inverse of the initial course).
In simple harmonic oscillator the particles are vibrating about an equilibrium position and there is no collision with another particle, therefore it retain the memory of the initial velocity throughout the simulation. The simple harmonic oscillator aims to illustrate that the velocity correlation in ideal system will continue for infinite amount of time.
Task
![]() |
|
The diffusion coefficients calculated using two different methods are in very close agreement and this is expected.
Source of error
According to following equation:
The integration range is to . However in our calculation the integration was stopped at time, and this could contribute to the error of data. Another source of error is the integration method. By using trapezium rule, we are dividing the graph into different rectangular strips. However, the graph itself can not be be describe perfectly using rectangular strips and will eventually result in overestimation (strips bigger than graph) or underestimation (strips smaller graph).