Week 1
weekmenu | week2 | week3 | week4 |week5 | week6 | Project
First week (Feb 7th-13th): Linux and gnuplot
We will start practicing with examples of the use of Linux and gnuplot. Linux is an operating system, have different distributions, some of them have General Public License (GNU). In this computer we use the UBUNTU distribution.
Gnuplot is a portable command-line driven graphing utility for linux and other platforms.
Using linux
1. Go to your folder, with cd command:
$cd hannah
2. Create a new folder with the name "week1", using mkdir command:
$mkdir week1
3. Check the folder you created, ls lists the contents of a directory:
$ls
4. Enter to week1
folder:
$cd week1
5. Copy the file examplex.tar.gz
that are in /home/lab/claudial/
in your new folder, with cp command:
$cp /home/lab/claudial/examplex.tar.gz /home/lab/hannah/week1/
or
$cp /home/lab/claudial/examplex.tar.gz .
for the last command line, be sure that you are in /home/lab/hannah/week1/
with pwd command:
$pwd
6. unzip the file:
$tar -xvzf examplex.tar.gz
7. Lists the contents of your current directory:
$ls
you will see the examplex.tar.gz
file and 3 new folders: example1
, example2
, example3
.
Example1
8. Go to the example1
folder and then lists the contents:
$cd example1 $ls
you will see a argon.control
file. If you want take a look of the file:
$gedit argon.control &
you will see the structure of the input file for run molecular dynamics.
9. Run the input file for lpmd
program:
$lpmd argon.control
the computer will run really fast, when this finish, lists the content of the directory and visualize the output file of the simulation with all the configurations in the time, output.xyz
$lpmd-visualizer -i xyz:file=output.xyz,inside=true -L 17.1191,17.1191,17.1191 -u lpvisual
press the o letter for see the simulation without perspective. This simulation is argon sample thermalized at 10 K.
10. Some dynamical properties of the simulation, like temperature and pressure, are in datos.dat
file, so how the file is large, we will visualize the first 10 lines of the file, with head command:
$head datos.dat
you will see 6 columns, for know what are each one, we can edit the argon.control
file and see what say the monitor
part, or we can search the monitor
part in the file with grep command
$grep "monitor" argon.control
so, the first column is the step number (of the simulation), then 2th temperature, 3th pressure, 4th potential energy, 5th kinetic-energy and finally the total energy. You will have to remember this for make the graphics!
11. We have to the GDR data, this is an structural propertie, very important for determine if the structure is an perfect crystal or it is an amorphous, the file is gdr.dat
:
$head gdr.dat
you will see 3 columns, the first is the distance between the atoms, the second is between what atoms we have the distances (in this case is between Ar and Ar) and the last column is the total g(r) (we will not graph this last.
Go to the gnuplot part for see the graphics!!
Using Gnuplot
With the sames examples that we ran after I will show you how obtain the graphics with gnuplot :)
Example1
1. If you are not in the folder example1, go there!:
$cd /home/lab/hannah/week1/example1
2. Lists the content, you have to see gdr.dat
and datos.dat
, now open gnuplot!! :)
$ls $gnuplot
This will open a gnuplot terminal.
3. First we will graph the temperature in each step, remember 1 column step and 2 column temperature:
gnuplot>plot "datos.dat" u 1:2 w l
u 1:2 means use this columns of the file datos.dat
and w l means that you want the graph with a line.
4. If you want put the names for the axis:
gnuplot>plot "datos.dat" u 1:2 w l gnuplot>set xlabel "step" gnuplot>set ylabel "temperature" gnuplot>replot
5. Now we will export this graph in a .png file:
gnuplot>set term png gnuplot>set output "T.png" gnuplot>replot gnuplot>exit
6. Now you are out of gnuplot terminal, so lists the directory, you will see the T.png
file, see its!
$display T.png
Now upload in this page
Do the same for this graphics, (put the names on the axis and export png) and upload:
steps vs pressure:
steps vs potential, kninetic and total energy:
7. Now graphic the gdr structural property:
$gnuplot gnuplot>plot "gdr.dat" u 1:2 w l gnuplot>set xlabel "step" gnuplot>set ylabel "temperature" gnuplot>replot gnuplot>set term png gnuplot>set output "gdr.png" gnuplot>replot gnuplot>exit
know upload it!!