User Tools

Site Tools


Determination of the melting temperature of a LJ system


you@eulerX ~$ module load courses mmm vmd

you@eulerX ~$ mmm-init

REMEMBER: this is the command to load the module for the cp2k program:
you@eulerX ~$ module load new cp2k

and to submit the job:

you@eulerX ~$ bsub < jobname

In this exercise, we will use a slab geometry (without vacuum region, so without a surface) with full periodic boundary conditions to study the melting behavior of nobel gases.

  • Download the 5.1 exercise into your $HOME folder and unzip it:
you@eulerX ~$ wget
you@eulerX ~$ tar -zxvf exercises:2016_ethz_mmm:exercise_5.1.tar.gz
you@eulerX ~$ cd exercise_5.1
All files of this exercise (all inputs and scripts are commented) can be also downloaded from the wiki: exercise_5.1.tar.gz

Before you run any simulations you should do the following things:

  • Chose the nobel gas that you would like to study and find corresponding parameters for the Lennard-Jones potential here:
  • Prepare the simulation cell and fulfill it with the atoms of chosen gas.

To do the last step you can use the template provided in the exercise folder ( The file contains positions of dummy atoms (named with X) in the unit cell oriented along [111] axis. All the positions are given in the units of first neighbor distance. Therefore you should rescale the unit cell using the correct first neighbor distance for your nobel gas and change atom names from X to the one you have chosen. Use the following command to do it (FND and ELEMENT must be changed by approximate first neighborg distance and element type respectively):

you@eulerX exercise_5.1$ m_xyzrescale FND < | sed 's/X/ELEMENT/' > 
  • In the Lennard-Jones potential parameter σ is directly related to the minimum energy distance between two atoms. What is this relationship? Please visit Wikipedia to get more information:
  • What is the physical meaning of the parameter ε in the Lennard-Jones potential?
  • What is the cohesive energy? How it can be related to the ε? Remember in the FCC structure one atom is surrounded by 12 neighbours.
  • Melting temperature of Lennard-Jones system is about 1/12 of cohesive energy. Try to estimate it, because this estimation will be used later

Open the file cell.inp and specify all the missing settings indicated as X. Unit cell parameters will be given to you in the second line of a freshly created file Now it is time to do the fist simulation, which is an optimization of the unit cell:

you@eulerX exercise_5.1$ bsub cp2k.popt -i cell.inp -o cell.out
  • Repeat the simulation with a larger cutoff. How does the cohesive energy per atom change? Why? How does the equilibrium lattice parameter change? Why?
Pay attention at the following line in the cp2k input file:


This means that:

  • The initial geometry will be larger then the provided one by factors of 2, 2, and 4 in X, Y and Z directions respectively
  • There are two such lines in the input file, and both are necessary.

This run should not take too much time, because you should have provided first neighbor distance value as the minimum energy of Lennard-Jones potential which is basically the same for the nobel gases at 0 K. Use the optimized geometry from the file as the initial geometry for the next run:

you@eulerX exercise_5.1$ tail -n 98 >  ./

For the next simulation you will need the file called half.inp. Open it and again provide all the necessary parameters. Note, that unit cell for this run can be found in the file opt_cell-1.restart (section CELL)

Now, run the simulation, that should melt your system:

you@eulerX exercise_5.1$ cp2k.popt -i half.inp -o half.out

It is a 10000 step molecular dynamics. While it is running you can complete the folowing assignments:

  1. Take a look at the file with vmd. Visualize it on the screen, and try to reproduce the figure similar to the one on the last slide of the lectures of today. Include the pbc box, create a representation with vdw, periodic images, rotate the sample, etc. Produce a snapshot and include the file in your assignment.
  2. Take a look at the half.inp file. How is the temperature controlled? Are all particles moving? Why? Which are the relevant sections for MD? Which kind of MD is it?
  3. Plot the -growing- half*ener file with gnuplot. How is temperature changing? Is there a conserved quantity?
  • At the end of the first dynamics (hint: tail -f half*ener) , you can examine the file by performing z-profiles using the script doprof:
you@eulerX exercise_5.1$ ./doprof 

The script calls the histogram script of last time, with a modification: a running window of configurations is averaged to produce a single frame. First, step 1-10, then step 10-20, and so on. At the end, the file, an animated gif is produced. If it works, you can run the command:

you@eulerX exercise_5.1$ animate -loop 0 -delay 100 

or download the file to your local machine and open in your internet browser. It will run the animation.

  1. Describe the profile you have obtained. What do you see?

Now, starting from the restart of this simulation, we equilibrate the system in nve, and we move all particles. But again some parameters needs to be specified in the file nve.inp. Use the simulation cell from the file half-1.restart. Also file with coordinates ( needs to be created. Use the coordinates from the last frame of the previous run.

And run the simulations:

you@eulerX exercise_5.1$ bsub cp2k.popt -i nve.inp -o nve.out

The resulting configuration (check) will be an equilibrated system (which profile?).

Now we have a file called “nve-1.restart”. Do not delete it !!! It will be used as a restart file for all simulations.


As explained in the class, we should run NPE (that is, constant energies but variable cell) simulations at energies which are above and below the supposed “melting energy” (energy corresponding to melting temperature). To make the exercise easier, we will run at constant volume (NVE) in this case.


For EACH temperature you should:

  • Copy the files TEMPnve.init.inp and TEMPnve.inp into 100nve.init.inp and 100nve.inp (for T=100) and then edit them in the appropriate points: PROJECT name, INITIAL temperature and RESTART filename and all other parameters specified as X
  • Run the first simulation: bsub cp2k.popt -i 100nve.init.inp -o 100nve.init.out ; This is a very short simulation to set the temperature using the old velocities. Why do you need it?
  • Run the second simulation: bsub cp2k.popt -i 100nve.inp -o 100nve.out
  • Observe the temperature and the z profile. Can you find the melting temperature? How do you choose temperatures?

And finally…

  • What is the melting temperature of the noble gas that you have chosen?
exercises/2016_ethz_mmm/t_melting.txt · Last modified: 2020/08/21 10:15 by