Изучение работы методов контроля температуры в молекулярной динамике

In [1]:
%%bash
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/etane.gro
--2021-05-25 22:41:50--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/etane.gro
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/etane.gro [following]
--2021-05-25 22:41:50--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/etane.gro
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 399
Saving to: `etane.gro.1'

     0K                                                       100% 5,55M=0s

2021-05-25 22:41:50 (5,55 MB/s) - `etane.gro.1' saved [399/399]

Файл et.top был дополнен связями и углами, типами атомов из ffbonded.itp. Тип функционала для торсионных углов - 3, а не 1.

In [2]:
!cat et.top
#include "/usr/share/gromacs/top/oplsaa.ff/forcefield.itp"

[ moleculetype ]
; Name            nrexcl
et            3

[ atoms ]
;   nr  type  resnr  residue  atom   cgnr     charge       mass
    1   opls_135   1    ETH      C1      1    -0.189      12.01
    2   opls_135   1    ETH      C2      2    -0.155      12.01
    3   opls_140   1    ETH      H1      3     0.0059       1.008
    4   opls_140   1    ETH      H2      4     0.0059       1.008
    5   opls_140   1    ETH      H3      5     0.0059       1.008
    6   opls_140   1    ETH      H4      6     0.0056       1.008
    7   opls_140   1    ETH      H5      7     0.0056       1.008
    8   opls_140   1    ETH      H6      8     0.0056       1.008

[ bonds ]
;  ai    aj funct  b0       kb
    1   2   1
    1   3   1
    1   4   1
    1   5   1
    2   6   1
    2   7   1
    2   8   1

[ angles ]
;  ai    aj    ak funct  phi0   kphi
;around c1
    3     1     4     1
    4     1     5     1
    3     1     5     1
    2     1     3     1
    2     1     4     1
    2     1     5     1
;around c2
    1     2     6     1
    1     2     7     1
    1     2     8     1
    6     2     7     1
    6     2     8     1
    7     2     8     1

[ dihedrals ]
;  ai    aj    ak    al funct
    3    1     2     6      3
    3    1     2     7      3
    3    1     2     8      3
    4    1     2     6      3
    4    1     2     7      3
    4    1     2     8      3
    5    1     2     6      3
    5    1     2     7      3
    5    1     2     8      3

[ pairs ]
; list of atoms 1-4
;  ai    aj funct
    3  6
    3  7
    3  8
    4  6
    4  7
    4  8
    5  6
    5  7
    5  8

[ System ]
; any text here
first one
[ molecules ]
;Name count
 et    1

Даны 5 конфигурационных файлов с разными алгоритмами контроля температуры:

  • be.mdp - метод Берендсена для контроля температуры.
  • vr.mdp - метод "Velocity rescale" для контроля температуры.
  • nh.mdp - метод Нуза-Хувера для контроля температуры.
  • an.mdp - метод Андерсена для контроля температуры.
  • sd.mdp - метод стохастической молекулярной динамики.
In [3]:
%%bash
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/be.mdp 
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/vr.mdp 
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/nh.mdp 
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/an.mdp 
wget http://kodomo.fbb.msu.ru/FBB/year_08/term6/sd.mdp
--2021-05-25 22:42:28--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/be.mdp
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/be.mdp [following]
--2021-05-25 22:42:28--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/be.mdp
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1356 (1,3K)
Saving to: `be.mdp.1'

     0K .                                                     100% 14,7M=0s

2021-05-25 22:42:29 (14,7 MB/s) - `be.mdp.1' saved [1356/1356]

--2021-05-25 22:42:29--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/vr.mdp
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/vr.mdp [following]
--2021-05-25 22:42:29--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/vr.mdp
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1427 (1,4K)
Saving to: `vr.mdp.1'

     0K .                                                     100% 14,1M=0s

2021-05-25 22:42:30 (14,1 MB/s) - `vr.mdp.1' saved [1427/1427]

--2021-05-25 22:42:30--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/nh.mdp
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/nh.mdp [following]
--2021-05-25 22:42:30--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/nh.mdp
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1429 (1,4K)
Saving to: `nh.mdp.1'

     0K .                                                     100% 15,2M=0s

2021-05-25 22:42:31 (15,2 MB/s) - `nh.mdp.1' saved [1429/1429]

--2021-05-25 22:42:31--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/an.mdp
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/an.mdp [following]
--2021-05-25 22:42:31--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/an.mdp
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1426 (1,4K)
Saving to: `an.mdp.1'

     0K .                                                     100% 14,4M=0s

2021-05-25 22:42:32 (14,4 MB/s) - `an.mdp.1' saved [1426/1426]

--2021-05-25 22:42:32--  http://kodomo.fbb.msu.ru/FBB/year_08/term6/sd.mdp
Resolving kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)... 192.168.180.1
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://kodomo.fbb.msu.ru/FBB/year_08/term6/sd.mdp [following]
--2021-05-25 22:42:32--  https://kodomo.fbb.msu.ru/FBB/year_08/term6/sd.mdp
Connecting to kodomo.fbb.msu.ru (kodomo.fbb.msu.ru)|192.168.180.1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1441 (1,4K)
Saving to: `sd.mdp.1'

     0K .                                                     100% 15,3M=0s

2021-05-25 22:42:33 (15,3 MB/s) - `sd.mdp.1' saved [1441/1441]

In [4]:
!ls
an.mdp	be.tpr	etane.gro  nh.mdp	sd.mdp
be.mdp	et.top	mdout.mdp  prac7.ipynb	vr.mdp

Из-за необходимости ручного ввода группы для преобразования в pdb, пришлось запускать команды ниже вручную.

In [1]:
types = ['be', 'vr', 'nh', 'an', 'sd']

for t in types:
    mdp = t + '.mdp'
    tpr = t + '.tpr'
    trr = t + '.trr'
    pdb = t + '.pdb'
    
    com1 = f"grompp -f {mdp} -c etane.gro -p et.top -o {tpr}"
    com2 = f"mdrun -deffnm {t} -v -nt 1"
    com3 = f"trjconv -f {trr} -s {tpr} -o {pdb}"
    
    print(com1)
    print(com2)
    print(com3)
    print("")
grompp -f be.mdp -c etane.gro -p et.top -o be.tpr
mdrun -deffnm be -v -nt 1
trjconv -f be.trr -s be.tpr -o be.pdb

grompp -f vr.mdp -c etane.gro -p et.top -o vr.tpr
mdrun -deffnm vr -v -nt 1
trjconv -f vr.trr -s vr.tpr -o vr.pdb

grompp -f nh.mdp -c etane.gro -p et.top -o nh.tpr
mdrun -deffnm nh -v -nt 1
trjconv -f nh.trr -s nh.tpr -o nh.pdb

grompp -f an.mdp -c etane.gro -p et.top -o an.tpr
mdrun -deffnm an -v -nt 1
trjconv -f an.trr -s an.tpr -o an.pdb

grompp -f sd.mdp -c etane.gro -p et.top -o sd.tpr
mdrun -deffnm sd -v -nt 1
trjconv -f sd.trr -s sd.tpr -o sd.pdb

In [7]:
!ls
#be.edr.1#  #mdout.mdp.1#  #vr.tpr.1#  be.gro	    nh.gro	 sd.pdb
#be.edr.2#  #mdout.mdp.2#  #vr.trr.1#  be.log	    nh.log	 sd.tpr
#be.gro.1#  #mdout.mdp.3#  an.cpt      be.mdp	    nh.mdp	 sd.trr
#be.gro.2#  #mdout.mdp.4#  an.edr      be.pdb	    nh.pdb	 vr.cpt
#be.log.1#  #mdout.mdp.5#  an.gro      be.tpr	    nh.tpr	 vr.edr
#be.log.2#  #mdout.mdp.6#  an.log      be.trr	    nh.trr	 vr.gro
#be.pdb.1#  #mdout.mdp.7#  an.mdp      be_prev.cpt  prac7.ipynb  vr.log
#be.tpr.1#  #mdout.mdp.8#  an.pdb      et.top	    sd.cpt	 vr.mdp
#be.tpr.2#  #vr.edr.1#	   an.tpr      etane.gro    sd.edr	 vr.pdb
#be.tpr.3#  #vr.gro.1#	   an.trr      mdout.mdp    sd.gro	 vr.tpr
#be.trr.1#  #vr.log.1#	   be.cpt      nh.cpt	    sd.log	 vr.trr
#be.trr.2#  #vr.pdb.1#	   be.edr      nh.edr	    sd.mdp	 vr_prev.cpt
In [1]:
from IPython.display import Image

Посмотрим на полученные результаты в PyMol. Они были визуализированы локально, сохранены покадрово, а затем собраны с помощью ffmpeg.

Метод Берендсена

In [2]:
display(Image("be.gif", format='png'))

Метод "Velocity rescale"

In [3]:
display(Image("vr.gif", format='png'))

Метод Нуза-Хувера

In [4]:
display(Image("nh.gif", format='png'))

Метод Андерсена

In [5]:
display(Image("an.gif", format='png'))

Метод стохастической молекулярной динамики

In [6]:
display(Image("sd.gif", format='png'))

Вывод: наименьшая подвижность наблюдается для контроля температуры методом Андерсена, наибольшая - для стохастической молекулярной динамики. Для метода "Velocity rescale" создается впечатление, что противолежащие водороды вращаются вместе, не заслоняя друг друга.

Сравним потенциальную энергию и кинетическую энергию для каждой из 5 систем.

Снова запустим команды ниже вручную, потому необходимо дополнительно вводить параметры выдачи: 10 - потенциальная энергия и 11 - кинетическая.

In [14]:
for t in types:
  
    com1 = f"g_energy -f {t}.edr -o {t}.xvg -xvg none"
    
    print(com1)
g_energy -f be.edr -o be.xvg -xvg none
g_energy -f vr.edr -o vr.xvg -xvg none
g_energy -f nh.edr -o nh.xvg -xvg none
g_energy -f an.edr -o an.xvg -xvg none
g_energy -f sd.edr -o sd.xvg -xvg none
In [2]:
import numpy as np
import matplotlib.pyplot as plt
def plot_energy(short, long):
    data_in = np.genfromtxt(short+'.xvg')
    x, pot, kin = data_in[:,0], data_in[:,1], data_in[:,2]
    
    fig, ax = plt.subplots(figsize=(10,5))
    ax.plot(x, pot, label='Потенциальная E')
    ax.plot(x, kin, label='Кинетическая E')
    ax.set_title(f'Метод {long}')
    ax.set_xlabel('Время (пс)')
    ax.set_ylabel('Энергия (кДж/моль)')
    ax.legend()
In [3]:
methods = ['Берендсена', '"Velocity rescale"', 'Нуза-Хувера',
           'Андерсена', 'стохастической молекулярной динамики']

for t, m in zip(types, methods):
    plot_energy(t, m)

Энергия этана при методе Андерсена оказалось наименьшей, что объясняет низкую подвижность молекулы при визуализации. Флуктуация энергии в методе Берендсена со временем уменьшается, а величина энергии остается более-менее постоянной. В остальных случаях энергии меняются в больших диапазонах. Для метода Нуза-Хувера наблюдается значительный разброс: энрегия оказывается как очень маленькой, так и очень большой. Однако чаще энергия находится на уровне менее 75 кДж/моль, а пики больше 150 хоть и встречаются, но не очень часто.

Распределение длины C-C связи

Сначала создадим индекс файл с одной связью.

In [8]:
!echo '[ bonds ]' > b.ndx
!echo '1 2' >> b.ndx
In [10]:
for t in types:
  
    com1 = f"g_bond -f {t}.trr -s {t}.tpr -o bond_{t}.xvg -n b.ndx -xvg none"
    
    !$com1
                         :-)  G  R  O  M  A  C  S  (-:

                   Great Red Oystrich Makes All Chemists Sane

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_bond  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f         be.trr  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n          b.ndx  Input        Index file
  -s         be.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o    bond_be.xvg  Output       xvgr/xmgr file
  -l      bonds.log  Output, Opt. Log file
  -d   distance.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   none    xvg plot formatting: xmgrace, xmgr or none
-blen        real   -1      Bond length. By default length of first bond
-tol         real   0.1     Half width of distribution as fraction of -blen
-[no]aver    bool   yes     Average bond length distributions
-[no]averdist  bool yes     Average distances (turns on -d)

Group     0 (          bonds) has     2 elements
There is one group in the index
Will gather information on 1 bonds
trn version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up distance.xvg to ./#distance.xvg.2#
Reading frame     200 time  200.000   

Total number of samples               : 251
Mean                                  : 0.153135
Standard deviation of the distribution: 0.00177711
Standard deviation of the mean        : 0.00011217

Back Off! I just backed up bond_be.xvg to ./#bond_be.xvg.2#

gcq#133: "You Fill Your Space So Sweet" (F. Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                   Great Red Oystrich Makes All Chemists Sane

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_bond  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f         vr.trr  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n          b.ndx  Input        Index file
  -s         vr.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o    bond_vr.xvg  Output       xvgr/xmgr file
  -l      bonds.log  Output, Opt. Log file
  -d   distance.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   none    xvg plot formatting: xmgrace, xmgr or none
-blen        real   -1      Bond length. By default length of first bond
-tol         real   0.1     Half width of distribution as fraction of -blen
-[no]aver    bool   yes     Average bond length distributions
-[no]averdist  bool yes     Average distances (turns on -d)

Group     0 (          bonds) has     2 elements
There is one group in the index
Will gather information on 1 bonds
trn version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up distance.xvg to ./#distance.xvg.3#
Reading frame     200 time  200.000   

Total number of samples               : 251
Mean                                  : 0.153297
Standard deviation of the distribution: 0.00371384
Standard deviation of the mean        : 0.000234415

gcq#133: "You Fill Your Space So Sweet" (F. Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                   Great Red Oystrich Makes All Chemists Sane

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_bond  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f         nh.trr  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n          b.ndx  Input        Index file
  -s         nh.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o    bond_nh.xvg  Output       xvgr/xmgr file
  -l      bonds.log  Output, Opt. Log file
  -d   distance.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   none    xvg plot formatting: xmgrace, xmgr or none
-blen        real   -1      Bond length. By default length of first bond
-tol         real   0.1     Half width of distribution as fraction of -blen
-[no]aver    bool   yes     Average bond length distributions
-[no]averdist  bool yes     Average distances (turns on -d)

Group     0 (          bonds) has     2 elements
There is one group in the index
Will gather information on 1 bonds
trn version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up distance.xvg to ./#distance.xvg.4#
Reading frame     200 time  200.000   

Total number of samples               : 251
Mean                                  : 0.153033
Standard deviation of the distribution: 0.00293297
Standard deviation of the mean        : 0.000185128

gcq#133: "You Fill Your Space So Sweet" (F. Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                   Great Red Oystrich Makes All Chemists Sane

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_bond  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f         an.trr  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n          b.ndx  Input        Index file
  -s         an.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o    bond_an.xvg  Output       xvgr/xmgr file
  -l      bonds.log  Output, Opt. Log file
  -d   distance.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   none    xvg plot formatting: xmgrace, xmgr or none
-blen        real   -1      Bond length. By default length of first bond
-tol         real   0.1     Half width of distribution as fraction of -blen
-[no]aver    bool   yes     Average bond length distributions
-[no]averdist  bool yes     Average distances (turns on -d)

Group     0 (          bonds) has     2 elements
There is one group in the index
Will gather information on 1 bonds
trn version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up distance.xvg to ./#distance.xvg.5#
Reading frame     200 time  200.000   

Total number of samples               : 251
Mean                                  : 0.153024
Standard deviation of the distribution: 0.00143875
Standard deviation of the mean        : 9.08129e-05

gcq#133: "You Fill Your Space So Sweet" (F. Apple)

                         :-)  G  R  O  M  A  C  S  (-:

                   Great Red Oystrich Makes All Chemists Sane

                            :-)  VERSION 4.5.5  (-:

        Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,
      Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, 
        Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, 
           Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schulz, 
                Michael Shirts, Alfons Sijbers, Peter Tieleman,

               Berk Hess, David van der Spoel, and Erik Lindahl.

       Copyright (c) 1991-2000, University of Groningen, The Netherlands.
            Copyright (c) 2001-2010, The GROMACS development team at
        Uppsala University & The Royal Institute of Technology, Sweden.
            check out http://www.gromacs.org for more information.

         This program is free software; you can redistribute it and/or
          modify it under the terms of the GNU General Public License
         as published by the Free Software Foundation; either version 2
             of the License, or (at your option) any later version.

                                :-)  g_bond  (-:

Option     Filename  Type         Description
------------------------------------------------------------
  -f         sd.trr  Input        Trajectory: xtc trr trj gro g96 pdb cpt
  -n          b.ndx  Input        Index file
  -s         sd.tpr  Input, Opt!  Structure+mass(db): tpr tpb tpa gro g96 pdb
  -o    bond_sd.xvg  Output       xvgr/xmgr file
  -l      bonds.log  Output, Opt. Log file
  -d   distance.xvg  Output, Opt. xvgr/xmgr file

Option       Type   Value   Description
------------------------------------------------------
-[no]h       bool   no      Print help info and quit
-[no]version bool   no      Print version info and quit
-nice        int    19      Set the nicelevel
-b           time   0       First frame (ps) to read from trajectory
-e           time   0       Last frame (ps) to read from trajectory
-dt          time   0       Only use frame when t MOD dt = first time (ps)
-[no]w       bool   no      View output .xvg, .xpm, .eps and .pdb files
-xvg         enum   none    xvg plot formatting: xmgrace, xmgr or none
-blen        real   -1      Bond length. By default length of first bond
-tol         real   0.1     Half width of distribution as fraction of -blen
-[no]aver    bool   yes     Average bond length distributions
-[no]averdist  bool yes     Average distances (turns on -d)

Group     0 (          bonds) has     2 elements
There is one group in the index
Will gather information on 1 bonds
trn version: GMX_trn_file (single precision)
Reading frame       0 time    0.000   
Back Off! I just backed up distance.xvg to ./#distance.xvg.6#
Reading frame     200 time  200.000   

Total number of samples               : 251
Mean                                  : 0.153474
Standard deviation of the distribution: 0.00322237
Standard deviation of the mean        : 0.000203394

gcq#133: "You Fill Your Space So Sweet" (F. Apple)

In [11]:
!ls | grep bond
#bond_be.xvg.1#
#bond_be.xvg.2#
bond_an.xvg
bond_be.xvg
bond_nh.xvg
bond_sd.xvg
bond_vr.xvg
In [4]:
def plot_bonds(short, long):
    data_in = np.genfromtxt('bond_'+short+'.xvg')
    x, l = data_in[:,0], data_in[:,1]
    
    fig, ax = plt.subplots(figsize=(10,5))
    ax.bar(x, l, width=0.0005)
    ax.set_title(f'Метод {long}')
    ax.set_xlabel('Длина связи, нм')
In [5]:
methods = ['Берендсена', '"Velocity rescale"', 'Нуза-Хувера',
           'Андерсена', 'стохастической молекулярной динамики']

for t, m in zip(types, methods):
    plot_bonds(t, m)

Для метода Андерсена диапазон колебаний длин связи оказался наименьшим, что согласуется с наименьшей энергией и общей заторможенностью структуры. Также заметно, что распределение для данного метода напоминает главное здание МГУ, то есть имеет 2 заметных пика, кроме центрального. У метода Берендсена наблюдается узкий пик для длины связи, что объясняется узким диапазоном энергий. У остальных методов распределения по связям сопоставимы, хотя у метода Нуза-Хувера пик всё же уже.

В среднем же длины связей оказываются сопоставимыми в диапазое 1.52-1.53 ангстрем, что соответствует действительности.

Построим распределение по потенциальной энергии

In [10]:
def plot_en_hist(short, long):
    data_in = np.genfromtxt(short+'.xvg')
    l = data_in[:,1]
    
    fig, ax = plt.subplots(figsize=(10,5))
    ax.hist(l, bins=250)
    ax.set_title(f'Метод {long}')
    ax.set_xlabel('Потенциальная энергия, кДж/моль')
In [11]:
for t, m in zip(types, methods):
    plot_en_hist(t, m)

Формы практически всех распределений, кроме методов Берендсена и Андерсена, соответсвтуют распределению Больцамана с различными параметрами. Лучше всего ситуации при нормальных условиях соответствует метод Нуза-Хувера.

Время работы mdrun

Астрономическое время из логов в секундах:

  • Метод Берендсена: 4.132

  • Метод "Velocity rescale": 4.236

  • Метод Нуза-Хувера: 4.153

  • Метод Андерсена: 4.066

  • Метод стохастической молекулярной динамики: 4.666

Время вычисления каждым из методов оказалось сопоставимым. Однако быстрее всего сработал метод Андерсена, что не удивительно, поскольку он рассчитывает небольшие изменения системы, так как энергия меняется слабо. Для стохастической молекулярной динамики потребовалось больше всего времени.

В целом данные выглядят так, что при симуляции процессов, проходящих при комнатной температуре, лучше всего подходит метод Нуза-Хувера. Методы с большим разбросом по энергии будут оптимальны при расчете высоких температур.