Talk:CE1014
JC: General comments: All tasks completed, but your written answers were very brief and lacked detail. Try to expand your explanations and go into a bit more depth on what your results show and their significance.
Simulations of Simple Liquids
Theory
Comparing the velocity-Verlet algorithm to the classical solution () of modelling the displacement of a harmonic oscillator as a function of time.



It can be seen that the maximum absolute error between the velocity-Verlet and the classical solution increases linearly as a function of time overall.

JC: Why does this happen and why does the error oscillate?
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?

The largest timestep possible before the energy increases by more than 1% than the average energy of the system is 0.28. The total energy of the system is kept fluctuating between 1% of the average, as energy in a real system must be conserved and the simulation must model this as closely as possible. The timestep 0.285 can be seen in the graph above and is fluctuating at just above 1% of the average energy.
JC: Good choice of timestep.
For a single Lennard-Jones interaction,;
• is found where , therefore:
As therefore
• Force at :
When :
• is found where
• Well depth at :
When
•
•
•
Number of molecules in 1 mL of water under standard conditions x molecules.
An atom in a cubic simulation box at position , moves along the vector , will end up in position vector if periodic boundary conditions are applied.
Volume = 2.99 x 10^-25 m^3 The Lennard-Jones parameters for argon are . If the LJ cutoff is , what is it in real units? What is the well depth in ? What is the reduced temperature in real units?
- distance
- energy
in J
For kJ/mol, multiply by Avogadro's number
- temperature
JC: All maths correct and nicely laid out. You should show your working for the number of water molecules in 1 ml and the volume of 1000 molecules.
Equilibriation Tasks
TASK: 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?
Generating random coordinates for atoms has the potential to place two atoms less than a radius away from each other, in which case the Lennard-Jones potential would not describe the system. This is not a good approximation to real life liquids as the intermolecular forces would not allow atoms that close.
JC: The Lennard-Jones potential can still describe interactions at distances of < sigma, but the repulsive forces generated when particles are placed very close together can make the system unstable and cause the simulation to crash.
The lattice spacing for a number density of 0.8 for a simple cubic unit cell:
where Number density; mass of atom; volume, where is the side length of the cubit unit cell.
Therefore and
Lattice spacing for a face centered cubic lattice:
If and
For a face-centered cubic lattice with 1000 lattices generated:
4000 atoms would have been created
JC: Values are correct, but you are calculating a number density not a mass density, so m in your equation is the number of atoms in the unit cell rather than the mass.
Meaning of LAMMPS code:
mass 1 1.0 : mass i value; where i = atom type; value = mass of atom
pair_style lj/cut/opt 3.0 : pair_style style args; style = definite style from list (lj/cut corresponds to cut off Lennard-Jones potential with no Coulomb. opt suffix has no effect functionally but means it has been optimized to run faster.); args = arguments used by a particular style (3.0 - cut off point in L-J)
pair_coeff 1 1 1.0 1.0 : pair_coeff I J args - I,J = atom type, coefficients for one or more pairs of atoms interacting with each other
JC: For the Lennard-Jones potential, the coefficients are the values of epsilon and sigma. Why do we use a cut off in the Lennard-Jones potential.
As we are specifying and , the integration algorithm used will be:
velocity-Verlet algorithm
The value ${timestep} variable is always replaced by 0.001 as this is what the variable is set to at the beginning of the script as:
This saves time when writing the simulation script as if we want to change the timestep in another simulation we would only have to input the value in once; where the variable was being set, rather than having to change the timestep each time is appears in the script. This also reduces the likelihood of mistakes as we won't be able to miss one value which could ruin the simulation.
JC: Correct.
Plots of the energy, temperature, and pressure, against time for the 0.001 timestep experiment:




Equilibrium: At time step 0.001, the energy, pressure and temperature all reach equilibrium in a short time of around 0.4 or 40 timesteps.
Choosing timestep: As can be seen from the above graph of energy as a function of time for varying timesteps, the timestep of 0.0025 gives around the same equilibrium value as using 0.001, but the simulation will not take as long as it's a higher value. For the values above 0.0025 the equilibrium energy is dependent on timestep, therefore although the simulation will take less time to run with shorter timesteps, it will not give us the accuracy needed. Therefore 0.0025 is the optimum timestep to choose out of the ones tested here. 0.015 is the worst timestep out of those tested as the total energy does not equilibriate in the time given.
JC: Good choice of timestep and justification.
Running Simulations Under Specific Conditions Tasks
Pressures ,, and temperatures, , chosen for Npt calculations:
2.75 and 3.0
1.6, 1.8, 2.0, 2.2 and 2.4
We need to find so that the temperature is correct if we multiply every velocity .
Determining .
Therefore:
, where we have chosen the positive sign of the square root as we do not want the gamma factor switching the direction of the velocities at each timestep.
JC: Good, clear derivation.
Importance of the three numbers 100 1000 100000 in the line - fix aves all ave/time 100 1000 100000...:
100: Use input value this many timesteps.
1000: Number of times to use input values for calculating averages.
100000: Calculate averages this many timesteps
JC: You should explain what these number mean in your own words and/or give and example so that it is clear that you understand them, rather than just copying the definitions from the LAMMPS manual.
For the next line run 100000 means that 100000 timesteps will be taken of 0.0025 therefore a time of 250.
TASK: 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 . 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?
The simulated density is lower than that predicted by the Ideal Gas Law. This is due to the Ideal Gas Law approximating 0 interactions between particles therefore the particles are able to get closer together in a box of specified volume than in our simulation where we use the L-J approximation which includes intermolecular forces.
The discrepancy increases with pressure.
JC: Would you expect the discrepancy to increase with pressure and how does the agreement between the results change with temperature? Don't fit the ideal gas law with a straight line as you know analytically that the ideal gas law will not give a straight line since density = 1/temperature.

Calculating Heat Capacities
TASK: As in the last section, you need to run simulations at ten phase points. In this section, we will be in density-temperature phase space, rather than pressure-temperature phase space. The two densities required at and , and the temperature range is . Plot as a function of temperature, where 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.

The trend is as expected as decreases as temperature increases and is consistent with the equation :
JC: Why is it what you expected, can you give more of an explanation? What are the curved lines on the graph, give the equations for lines of best fit.
Example of input script:


Radial Distribution Function

At radius 0, the RDF is also 0 as atoms cannot pack on top of each other. The solid data has more peaks indicating a regular structure as the atoms are arranged in lattices. The liquid has less peaks corresponding to increasing disorder, and the gas even more so. At large r, g(r) tends to 1 as it gets closer to the density of the whole system.
JC: Try to be a bit more specific, the liquid has short ranged order (peaks at small r), but no long ranged order, unlike in the solid.
Solid RDF The first three peaks are labeled in the above graph which correspond to the 3 nearest atoms from the origin atom. As the structure is FCC we can see from the image below which spacings the 3 peaks correspond to with value 1, 2 and 3 being 0.975, 1.425 and 1.725 respectively. Therefore the lattice spacing is 1.425, corresponding to the the second peak on the graph and spacing labeled 2 on the image below.
The coordination number for each site is as follows:
1 = 12
2 = 6
3 = 24

JC: Good idea to include a diagram of an fcc lattice and correct value for the lattice spacing. You could have also calculated this from the first and third peaks and taken an average. How did you get the coordination number, did you plot the integral of the RDF?
Displacement
Plots showing the mean squared displacement as a function of timestep for simulations in different states.

Plot showing MSD for a simulation with 1 million atoms.

where is the linear equation from the graphs above.
Therefore
Solid simulation: x
Liquid simulation: x
Vapour simulation: x
For simulation with 1 million atoms:
Solid simulation: x
Liquid simulation: x
Vapour simulation: x
JC: Data looks good, what are the units?
Velocity Autocorrelation Function
Evaluate the normalised velocity autocorrelation function for a 1D harmonic oscillator (it is analytic!):
Position of a 1D harmonic oscillator as a function of time:
Therefore and
and
so
JC: Derivation looks good, but it would be good to show a few more steps in your working, especially the trigonometric identities that you use to perform the integration.
Be sure to show your working in your writeup. On the same graph, with x range 0 to 500, plot with 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.
The minima in the graph simulate where atoms have collided. Solid moves very little as lattice structure so D is almost 0 in both cases. The HO is very different as its a approximation and does not take in quantum effects - it is just using classical equations. For our simulation
JC: The simulations are also classical and don't account for quantum effects. The VACF for the solid and liquid decay to zero because of collisions between atoms which randomise the velocities. There are no collisions in the harmonic oscillator.
Liq integer where
Solid int = -0.571363169 where
Vapour int = 2197 where




For 1 million atoms
Liq integer where
Solid int where
Vapour int where


