 For this exercise, you will use the last step of the equilibration of ubiquitin
in a water sphere ubq ws eq.restart.coor. You will use the temperature coupling
feature of NAMD2 to set the temperature of the molecules in the outer
layer of the sphere to 200 K. You will determine the thermal diffusivity by
monitoring changes of the system's temperature and comparing them to the
theoretical expression.

1 Make sure that you are in this problem' working directory (2-6-heat_diff/):

2 Launch VMD.

3 Open the VMD tkcon window by choosing the the Extensions ! tkcon
menu item.

4 Load the system into VMD by typing the following in the VMD tkcon
window:

mol load psf ubq_ws.psf namdbin ubq_ws_eq.restart.coor

5 Select all atoms in the system:

set selALL [atomselect top all]

6 Find the center of the system:

set center [measure center $selALL weight mass]

7 Find X, Y and Z coondinates of the system's center:

foreach {xmass ymass zmass} $center { break }

8 Select atoms in the outer layer:

set shellSel [atomselect top "not ( sqr(x-$xmass) + sqr(y-$ymass) + sqr(z-$zmass) <= sqr(22) ) "]

9 Set beta parameters of the atoms in this selection to 1.00:

$shellSel set beta 1.00

10 Select the entire system again:

set selALL [atomselect top all]

11 Create the pdb file that marks the atoms in the outer layer by 1.00 in
the beta column:

$selALL writepdb ubq_shell.pdb

12 You can now quit VMD.

13 Run NAMD2 for the configuration file ubq_cooling.conf. Make sure
that the output file is ubq_cooling.log.

14 Use namdplot to find out how the system's temperature changes with
time:

namdplot TEMP ubq_cooling.log

The xmgrace program window will pop up.

15 In the xmgrace program, choose the Data -> Transformations -> Geometrical
transform... menu item. In the Scale X: window, type 2.0, which
corresponds to the time step used in your simulation. Press Accept, which
will rescale the plot.

16 You will now fit the simulated temperature dependence to the theoretical
expression. For this, you will use the Non-linear
curve fitting feature of xmgrace.

17 Choose the Data -> Transformations -> Non-linear curve fitting... menu
item. In the Source -> Set window, click on the last line, which corresponds
to the simulated time dependence.

18 In the Main tab, type or copy and paste over the Formula window (make
sure it is a one line):

y= 200 + 66.87*(exp( -0.0146*a0*x) +0.25*exp( -0.25*0.0146*a0*x)+1/9*exp(-1/9*0.0146*a0*x) +1/16*exp(-1/16*0.0146*a0*x)+1/25*exp(-1/25*0.0146*a0*x) +1/36*exp(-1/36*0.0146*a0*x)+1/49*exp(-1/49*0.0146*a0*x) +1/64*exp(-1/64*0.0146*a0*x)+1/81*exp(-1/81*0.0146*a0*x) +1/100*exp(-1/100*0.0146*a0*x) )

19 In the Parameters drop-down menu, choose 1. Windows will appear below.
Click several times on the Apply, to get a better fit. This will fit the curve
and get a value for the parameter a0, which is the thermal diffusivity.

20 Multiply the value of the a0 parameter by 0.1 to get the thermal diffusivity
in cm^2/s. You should get a value of around 0.45*10^(-3) cm^2/s.
How does your result compare to the thermal diffusivity of water D =
1.4*10^(-3) cm^2/s?

