Molecular Dynamic Simulation of united atom liquid n-hexane
Molecular Dynamic Simulation of united atom liquid n-hexane
Molecular Dynamic Simulation of united atom liquid n-hexane
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
Outline:<br />
Computational Chemistry - Practical 4<br />
<strong>Molecular</strong> <strong>Dynamic</strong> <strong>Simulation</strong> <strong>of</strong> United Atom -<br />
Liquid n-<strong>hexane</strong><br />
1. Aims<br />
2. Building topology file<br />
3. Running molecular dynamics simulation<br />
4. Analysis <strong>of</strong> results<br />
1
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
1. Aims<br />
The following practical deals with a MD simulation <strong>of</strong> <strong>liquid</strong> n-<strong>hexane</strong> by means <strong>of</strong> the simulation<br />
package YASP. During the practice, you will learn how to create a topology file for n-<strong>hexane</strong> which<br />
requires more information than that <strong>of</strong> water. You will study the torsion angle distribution as well as<br />
the internal molecular dynamics related to torsion by comparing the simulation carried out with two<br />
different torsion potential. Your tasks are the following:<br />
− Build the topology file,<br />
− Equilibrate the system,<br />
− Analyze the sampling <strong>of</strong> the system in equilibrium trajectory.<br />
2. Building topology file<br />
The System<br />
In this exercise you will use a particular model <strong>of</strong> n-<strong>hexane</strong> (fig1). The carbon <strong>atom</strong>s together with the<br />
bound hydrogen <strong>atom</strong>s are gathered in a single super-<strong>atom</strong> named <strong>united</strong> <strong>atom</strong>, such that the molecule<br />
consists <strong>of</strong> six interaction centers <strong>of</strong> two species, four CH2 and two CH3 <strong>united</strong> <strong>atom</strong>s (fig2). This<br />
reduced number <strong>of</strong> degrees <strong>of</strong> freedom speeds up the simulation in contrast to a simulation where all<br />
the <strong>atom</strong>s are explicitly taken into account. You will use a relatively small system <strong>of</strong> 100 molecules.<br />
Fig1. n-<strong>hexane</strong> molecule. C6H14.<br />
Fig2. n-<strong>hexane</strong> molecule with in the <strong>united</strong> <strong>atom</strong> model.<br />
2
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
Topology file<br />
In the topology file, the following parameters should be used:<br />
• Atoms:<br />
CH3 CH2<br />
Mass m 15 u 14 u<br />
LJ epsilon 0.73 kJ/mol 0.48 kJ/mol<br />
LJ sigma 0.3970 nm 0.3970 nm<br />
charge q 0 0<br />
• Bonds: 0.153 nm<br />
• Angles:109.47 deg (tetrahedron angle!), 520 kJ/mol rad 2<br />
• Torsions:<br />
Angle - [deg]<br />
Dihedral<br />
τ<br />
0<br />
Periodicity<br />
n<br />
K [kJ/mol]<br />
180 1 9.8<br />
180 2 6.6<br />
180 3 10.6<br />
1. the torsion potential has the following analytic shape<br />
3 K n<br />
V ( τ ) = ∑ [ 1−<br />
cos( n(<br />
τ −τ<br />
0 )) ]<br />
n=<br />
1 2<br />
2. Write the topology file for a single n-<strong>hexane</strong> molecule. Use the file <strong>hexane</strong>-1.tp (copy from<br />
directory /data/home/fleroy/students/exercises/prac4) as a starting point. It contains the<br />
keywords and information about the file format.<br />
3. Create the system topology file <strong>hexane</strong>-100.tp with the tool jointp.<br />
Below is the topology file:<br />
title:<br />
<strong>hexane</strong><br />
<strong>atom</strong>s:<br />
6<br />
1 'CH3' 15.0 0.73 0.397 0.000<br />
2 'CH2' 14.0 0.48 0.397 0.000<br />
3 'CH2' 14.0 0.48 0.397 0.000<br />
4 'CH2' 14.0 0.48 0.397 0.000<br />
5 'CH2' 14.0 0.48 0.397 0.000<br />
6 'CH3' 15.0 0.73 0.397 0.000<br />
constraints:<br />
5<br />
1 1 2 0.153<br />
2 2 3 0.153<br />
3 3 4 0.153<br />
4 4 5 0.153<br />
5 5 6 0.153<br />
angles:<br />
3
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
4<br />
1 1 2 3 109.47 520.0<br />
2 2 3 4 109.47 520.0<br />
3 3 4 5 109.47 520.0<br />
4 4 5 6 109.47 520.0<br />
torsions:<br />
9<br />
1 1 2 3 4 180 1 9.8<br />
2 1 2 3 4 180 2 6.6<br />
3 1 2 3 4 180 3 10.6<br />
4 2 3 4 5 180 1 9.8<br />
5 2 3 4 5 180 2 6.6<br />
6 2 3 4 5 180 3 10.6<br />
7 3 4 5 6 180 1 9.8<br />
8 3 4 5 6 180 2 6.6<br />
9 3 4 5 6 180 3 10.6<br />
modified_nonbonded:<br />
12<br />
1 1 2 0.0 0.0 0.0 0.0<br />
2 1 3 0.0 0.0 0.0 0.0<br />
3 1 4 0.8737 0.343 0.0 0.0<br />
4 2 3 0.0 0.0 0.0 0.0<br />
5 2 4 0.0 0.0 0.0 0.0<br />
6 2 5 0.7843 0.3386 0.0 0.0<br />
7 3 4 0.0 0.0 0.0 0.0<br />
8 3 5 0.0 0.0 0.0 0.0<br />
9 3 6 0.8737 0.343 0.0 0.0<br />
10 4 5 0.0 0.0 0.0 0.0<br />
11 4 6 0.0 0.0 0.0 0.0<br />
12 5 6 0.0 0.0 0.0 0.0<br />
molecules:<br />
6<br />
1 1<br />
2 1<br />
3 1<br />
4 1<br />
5 1<br />
6 1<br />
basta:<br />
4
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
3. <strong>Molecular</strong> dynamics simulation<br />
NOTICE: Use mkmdinput to make an input file. For all the molecular dynamics here, cut<strong>of</strong>f is<br />
1.1nm, neighbor list cut<strong>of</strong>f 1.2nm, verbose = 5. You may need copy files listed below from<br />
/data/students/exercises/prac4: <strong>hexane</strong>-1.tp, <strong>hexane</strong>-1.co, tor1.dat , tor2.dat, tor3.dat, merge.csh,<br />
average.cpp<br />
a. Create a box <strong>of</strong> equilibrated <strong>liquid</strong> n-<strong>hexane</strong> starting from a one molecule coordinate file<br />
The coordinate file <strong>hexane</strong>-1.co (copy from /data/home/fleroy/students/exercises/prac4) gives the<br />
coordinates <strong>of</strong> one n-<strong>hexane</strong> molecule. Now place 100 molecules into a box with the tool position.<br />
Before you run the program think about the box size. The molecules should not overlap, but the system<br />
should neither be too dilute. To obtain a reasonable box size for 100 n-<strong>hexane</strong> molecules, you can use<br />
density <strong>of</strong> <strong>liquid</strong> n-<strong>hexane</strong> at normal conditions to calculate it (656kg/mol, 298K). The calculated cubic<br />
box dimension along one direction is around 2.8nm.<br />
The system has to be equilibrated. This is done in two steps: in the first run the internal structure <strong>of</strong> the<br />
molecule should relax, so that strong deviations <strong>of</strong> internal degrees <strong>of</strong> freedom (e.g. angles) vanish,<br />
and overlaps <strong>of</strong> <strong>atom</strong>s are removed. In the second step the density has to be equilibrated. The system<br />
runs until the density has reached its final value.<br />
For equilibration, in our case, both NVT and NPT simulation are employed.<br />
1). NVT: first, you should remove isotropic pressure coupling in the input file. Run the simulation<br />
50000 steps with time-step (2fs) and temperature coupling time (300K, 0.2ps).<br />
2). NPT: Now the density <strong>of</strong> the system has to be equilibrated using isotropic pressure control<br />
(101.3 0 1.0e-6 5). Start the simulation using the final output coordinates from the last simulation as<br />
the input coordinates. Another 50000 steps with the same time-step and the same temperature coupling<br />
time is run.<br />
3). NPT: equilibrate the system again with NPT but with a shorter pressure coupling time (101.3 0<br />
1.0e-6 2). Start the simulation using the final output coordinates from the last simulation as the input<br />
coordinates. Another 300000 steps (every 300 timestep is suggested for output) with the same timestep<br />
and the same temperature coupling time is run.<br />
4). Monitor the density and temperature with plot_values, determing if it has equilibrated (exp.<br />
656kg/mol, 298K). With the programs jmol or vmd, you can get an impression <strong>of</strong> the spatial structure<br />
<strong>of</strong> n-<strong>hexane</strong>. But before that, you need get a .xyz file using:<br />
yasp2xyz < md.co > md.xyz<br />
b. Production simulation<br />
Run a long simulation (about 100000 steps) using the final output coordinates from the last simulation<br />
as the input coordinates. Use the last input file, except changing the simulation steps (keep the other<br />
5
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
parameters the same, every 50 timestep is suggested for output). Keep the final output file and<br />
trajectory file as the source for data analysis.<br />
4. Analysis <strong>of</strong> results<br />
Now the production run can be analyzed. We will use some <strong>of</strong> the tools <strong>of</strong> YASP to analyze the<br />
behavior <strong>of</strong> the conformations.<br />
1. Compute the average mass density <strong>of</strong> the system.<br />
Use plot_values tool.<br />
2. Use the program trjtors and extract data file <strong>of</strong> torsion angles time-dependence.<br />
trjtors trj_file < template_file<br />
For this you need to specify a template file for each torsion. Use the files tor1.dat, tor2.dat, and<br />
tor3.dat separately as template_file for dihedral angle 1, 2, and 3. You need to create a different<br />
directory for each torsion. For example use directory /torsion1 (head torsion) for dihedral angle 1,<br />
including the output trajectory file, and the template file (tor1.dat) there. Using the tool trjtors, you<br />
will obtain 100 files that represent 100 molecules with two columns, indicating time and respective<br />
torsional angle. The output files created by trjtors are automatically named as t00001,<br />
t00002,…t00100.<br />
3. Merge all the files into a resulting file using merge.csh that you will copy from<br />
/data/home/fleroy/students/exercises/prac4<br />
./merge.csh<br />
After running merge.csh, you obtain a file named as resultfile that includes all torsional data for 100<br />
molecules. Use it as input file for the program torsclass to sort torsional angles into conformations.<br />
The torsional angles are divided into three states: gauch + (0-120degree), trans (120-240), gauch - (240-<br />
360), set as 1, 2, 0 .<br />
torsclass 120 240 360 < resultfile > tors_state<br />
The output file “tors_state” contains two columns; one is the time the other is an integer number 0, 1<br />
or 2, denoting the state (conformation trans/gauche). You can average the state <strong>of</strong> 100 molecules by<br />
using average with “tors_state” as input file.<br />
average tors_state frame-number > ave_tors_state<br />
For example, if you ran 100000 steps, and recorded a frame every 50 steps, then the parameter framenumber<br />
is 2000. You should obtain a file named as “ave_tors_state”. Use the program ccf to calculate<br />
the autocorrelation function c (t)<br />
defined below. However, “ave_tors_state” cannot directly be used as<br />
input file for ccf, since ccf needs 3 columns, with the last two having the same value. Make an input<br />
file for ccf (it expects 3columns) with “awk”.<br />
awk ‘{print ($1, $2, $2)}’ ave_tors_state > ccf_input<br />
6
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
You can finally get the autocorrelation function <strong>of</strong> the torsion state:<br />
ccf ccf_output<br />
Use xmgrace ccf_output to view it.<br />
Autocorrelation function for torsion state:<br />
( h(<br />
t)<br />
− h )( h(<br />
0)<br />
.<br />
c(<br />
t)<br />
=<br />
( h(<br />
t)<br />
− h<br />
where h(t) is the respective state (trans/gauche) at time t .<br />
4. Follow the same procedure to calculate the other two c(t). (central torsion (tor2.dat) and the<br />
other end torsion (tor3.dat)). For all the repeated commands, you can make a shell script<br />
program to run in torsion2 and torsion 3.<br />
Plot the result for every torsion on separate graphs. Plot the three results in a single figure where you<br />
will restrict the time-scale to an interval where the decrease <strong>of</strong> the curves can clearly be seen.<br />
5. Compute the distribution <strong>of</strong> the torsion angles.<br />
This can be done by applying the tool distribtors. That program reads the file resultfile produced<br />
previously. Copy from the directory /data/home/fleroy/students/exercises/prace4/ the program<br />
distribtors to the three directories you have created for each torsion. Run it by simply typing<br />
./distribtors<br />
The program will ask you for the number <strong>of</strong> lines in resultfile. This can be obtained by a UNIX<br />
command:<br />
wc –l resultfile<br />
Or more directly by multiplying the number <strong>of</strong> frames written in the trajectory file by the number <strong>of</strong><br />
molecules.<br />
You will collect a file named tors_angl_dist.dat which contains the probability distribution <strong>of</strong> finding<br />
an angle having a given value for the considered torsion.<br />
Plot the results in a single figure so as to compare them.<br />
6. Calculate the center-<strong>of</strong>-mass diffusion coefficient<br />
First with cmtrj create the center <strong>of</strong> mass trajectory. Use msd to obtain the mean square displacement<br />
from the trajectory. And then compute the diffusion coefficient using diffcoeff.<br />
Both the programs msd and cmtrj need separate template files. We set msd.tpl as the template file for<br />
msd, and cm.tpl as that for cmtrj. First, create cm.tpl with the YASP tool<br />
mkcmtrjtemplate cm.tpl<br />
2<br />
)<br />
−<br />
h )<br />
7
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
Then extract the center <strong>of</strong> mass trajectory file by:<br />
cmtrj md.trj cm.trj < cm.tpl<br />
To create msd.tpl, type:<br />
echo 1 1> msd.tpl<br />
then use msd and diffcoeff to calculate the diffusion coefficient <strong>of</strong> n-<strong>hexane</strong>. (Remember, calculate<br />
msd.dat from the center <strong>of</strong> mass trajectory)<br />
7. Modifying the torsion potential.<br />
An important advantage <strong>of</strong> the simulation approach is that it allows tuning force-field parameters in<br />
order to understand related mechanisms.<br />
Here, you are proposed to modify the coefficients <strong>of</strong> the torsion potential and probe the effect <strong>of</strong> such a<br />
change on the torsion dynamics, the torsion angle distribution as well as on the mass density and the<br />
diffusion coefficient.<br />
Create a new directory where you will run the same simulation as previously but using a different<br />
torsion potential. Use the same initial coordinates file, the same MD parameters files and the same<br />
topology file where you will have replaced the torsion potential coefficients<br />
K1 = 9.8 kJ/mol, K2 = 6.6 kJ/mol, and K3 = 10.6 kJ/mol<br />
by<br />
K´1 = 5.9037kJ/mol, K´2 = -1.13386 kJ/mol, and K´3 = 13.15868 kJ/mol .<br />
Run the different steps (equilibration and production). Analyze the production trajectory the same way.<br />
8
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
Questions<br />
1. The torsion potential has the following analytic form:<br />
K n<br />
V ( τ ) =<br />
τ<br />
2<br />
3<br />
∑<br />
n=<br />
1<br />
[ 1−<br />
cos( n(<br />
τ − ]<br />
a. Plot the torsion energy as a function <strong>of</strong> the dihedral angle varying from 0 to 360 degree for<br />
both the potential you used on the same graph (notice that τ0 is 180 for both the potentials). This can<br />
be achieved by using the program gnuplot. Open a gnuplot session by typing:<br />
gnuplot<br />
then type<br />
f ( x)<br />
= K<br />
K<br />
3<br />
And<br />
1<br />
* 0.<br />
5*<br />
( 1<br />
+<br />
cos( 3.<br />
14159 / 180*<br />
( x))<br />
+ K<br />
* 0.<br />
5*<br />
( 1+<br />
cos( 3*<br />
3.<br />
14159 / 180*<br />
( x)))<br />
g(<br />
x)<br />
= K<br />
K<br />
'<br />
3<br />
'<br />
1<br />
* 0.<br />
5*<br />
( 1<br />
* 0.<br />
5*<br />
( 1<br />
+<br />
+<br />
plot [0:360] f(x), g(x)<br />
cos( 3.<br />
14159 / 180 * ( x))<br />
+ K<br />
cos( 3*<br />
3.<br />
14159 / 180 * ( x)))<br />
Prepare a postscript file <strong>of</strong> your plot:<br />
set terminal postscript color<br />
set output ‘torsions.ps’<br />
replot<br />
If you need to go back to your plot<br />
set terminal x11<br />
Quit gnuplot by typing exit.<br />
2<br />
'<br />
2<br />
* 0.<br />
5*<br />
( 1<br />
* 0.<br />
5*<br />
( 1<br />
0 ))<br />
−<br />
−<br />
cos( 2*<br />
3.<br />
14159 / 180*<br />
( x)))<br />
+<br />
cos( 2 * 3.<br />
14159 / 180 * ( x)))<br />
+<br />
b. What are a trans and a gauche conformations? Suppose the plot represents the torsion<br />
potential <strong>of</strong> the central torsion angle <strong>of</strong> n-<strong>hexane</strong>. Use Newman projection to describe the<br />
conformations corresponding to the maxima and the minima observed in the figure.<br />
2. Did the two torsion potentials you used yield different angle distributions? Explain why by<br />
considering the two plots <strong>of</strong> the torsion potential and especially the barrier energy to overcome to pass<br />
form a trans configuration to a gauche configuration.<br />
3. a. Plot the torsion state autocorrelation functions for 3 dihedral angles (head/tail and central) and the<br />
two different potentials.<br />
9
THEORETICAL PHYSICAL CHEMISTRY TU DARMSTADT<br />
b. For an auto-correlation function, what do c(t)=1 and c(t)=0 mean?<br />
c. Suppose we would roughly fit the time decay <strong>of</strong> the auto-correlation function with an exponential<br />
⎛ t ⎞<br />
function having the form c 0 exp⎜−<br />
⎟ where τ is a relaxation time. Since c0 would be equal to 1, one<br />
⎝ τ ⎠<br />
can obtain an estimate <strong>of</strong> τ by finding at which value <strong>of</strong> t the function c(t) is equal to 1/e. Give out the<br />
values you obtain for the relaxation time <strong>of</strong> each torsion and both the torsion potential.<br />
d. Compare the relaxation time for head/tail torsion and central torsion. What does it mean if the<br />
torsion has a faster relaxation time in one case compared to the other? And theoretically, which<br />
relaxation time should be longer, the head/tail torsion or the central torsion? Explain why.<br />
e. Consider the plot <strong>of</strong> the torsion potentials again to answer the following questions: Starting from<br />
a gauche conformation, which potential has the lowest energy barrier to be overcome in order to reach<br />
a trans state or a gauche state? Then, which potential do you expect to let a torsion angle loose the<br />
memory <strong>of</strong> its state faster? Is your conclusion consistent with the calculations you carried out. Explain<br />
why.<br />
4. Compare the mass density you obtained with both the torsion potentials. Does the torsion potential<br />
affect that quantity?<br />
5. Same question for the diffusion coefficients. Compare your result to experiments:<br />
Dn-<strong>hexane</strong>=4.15 10 -9 m 2 s -1 .<br />
Further Readings:<br />
1. Albert, R A and Silbey,R J, Physical Chemistry, John Wiley & Sons.(3rd ed), 2001, 784-787.<br />
2. Leach, A.R, <strong>Molecular</strong> Modelling: Principles and Applications (2nd ed), 2001, 374-379.<br />
4. W. Jorgensen, J. Tirado-Rives, J. phys. Chem. 1996, 100, 14508.<br />
10