Skip to content

Commit 2fc5086

Browse files
committed
updated bulk
1 parent f9d26d6 commit 2fc5086

1 file changed

Lines changed: 74 additions & 133 deletions

File tree

docs/sphinx/source/tutorials/tutorial1/bulk-solution.rst

Lines changed: 74 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -570,8 +570,8 @@ value, which is usually the sign that the atoms are located at appropriate
570570
distances from each other. The system is now in a favorable state
571571
and the molecular dynamics simulation can be started.
572572

573-
Minimalist :math:`NVT` input file
574-
=================================
573+
Molecular dynamics (:math:`NVT`)
574+
================================
575575

576576
Let us first perform a short (20 picoseconds)
577577
equilibration in the :math:`NVT` ensemble. In the :math:`NVT` ensemble,
@@ -592,133 +592,67 @@ Here, the molecular dynamics (md) integrator is used, which is a leap-frog
592592
algorithm integrating Newton equations of motion. A number of 20000 steps with
593593
a timestep ``dt`` equal of :math:`0.001 ~ \text{ps}` will be performed.
594594

595-
Let us also ask GROMACS to print the trajectory in a compressed **.xtc** file
596-
every 1000 steps, or every 1 ps, by adding the following line to **nvt.mdp**:
597-
598-
.. code-block:: bw
599-
600-
nstxout-compressed = 1000
601-
602-
Let us also control the temperature throughout the
603-
simulation using the so-called ``v-rescale`` thermostat, which is
604-
a Berendsen thermostat with an additional stochastic term :cite:`bussi2007canonical`:
595+
Let us cancel the translational of the center of mass
596+
of the system:
605597

606598
.. code-block:: bw
607599
608-
tcoupl = v-rescale
609-
ref-t = 360
610-
tc-grps = system
611-
tau-t = 0.5
612-
613-
The ``v-rescale`` thermostat is known to give a proper canonical
614-
ensemble. Here, we also specified that the thermostat is
615-
applied to the entire system using the ``tc-grps`` option and that the
616-
damping constant for the thermostat, ``tau-t``, is equal to 0.5 ps.
600+
comm_mode = linear
601+
comm_grps = system
617602
618-
Note that the relatively high temperature of :math:`360~\text{K}`
619-
has been chosen here to reduce the viscosity of the solution and
620-
decrease the equilibration duration.
621-
622-
We now have a minimalist input file for performing
623-
the first :math:`NVT` simulation. Run it by typing in the terminal:
603+
Let us give an initial kick to the atom so that the initial
604+
total velocities give the desired temperature of :math:`360~\text{K}`:
624605

625606
.. code-block:: bw
626607
627-
gmx grompp -f inputs/nvt.mdp -c min.gro -o nvt -pp nvt -po nvt
628-
gmx mdrun -v -deffnm nvt
629-
630-
Here ``-c min.gro`` option ensures that the previously
631-
minimized configuration is used as a starting point for the :math:`NVT` simulation.
608+
gen-vel = yes
609+
gen-temp = 360
632610
633-
After the completion of the simulation, we can
634-
ensure that the system temperature indeed reached
635-
the value of :math:`360~\text{K}` by using the energy command of
636-
GROMACS. In the terminal, type:
611+
Let us also specify the neighbor searching parameters:
637612

638613
.. code-block:: bw
639614
640-
gmx energy -f nvt.edr -o nvt-T.xvg
641-
642-
and choose 10 for temperature, and then press enter twice.
643-
644-
From the generated *nvt-T.xvg* file, one can see that temperature
645-
started from 0 K, which was expected since the atoms have no velocity
646-
during a minimization step, and reaches a temperature slightly larger than the
647-
requested 360 K after a duration of a few picoseconds.
648-
649-
In general, it is better to perform a longer equilibration, but simulation
650-
durations are kept as short as possible for these tutorials.
651-
652-
.. figure:: ../figures/level1/bulk-solution/temperature-nvt-minimal-light.png
653-
:alt: Gromacs tutorial : temperature versus time.
654-
:class: only-light
655-
656-
.. figure:: ../figures/level1/bulk-solution/temperature-nvt-minimal-dark.png
657-
:alt: Gromacs tutorial : temperature versus time.
658-
:class: only-dark
659-
660-
.. container:: figurelegend
661-
662-
Figure: Evolution of the temperature :math:`T` as a function of
663-
the time :math:`t` during the NVT equilibration. The dashed line is the
664-
requested temperature of 360 K.
665-
666-
Improving the NVT input
667-
=======================
615+
cutoff-scheme = Verlet
616+
nstlist = 10
617+
ns_type = grid
668618
669-
So far, very few commands have been placed in the
670-
*.mdp* input file, meaning that most of the instructions
671-
have been taken by GROMACS from the default
672-
parameters. You can find what parameters were used
673-
during the last nvt run by opening the new *nvt.mdp*
674-
file that has been created in the main folder.
675-
Exploring this new *nvt.mdp* file shows us that, for
676-
instance, plain cut-off Coulomb interactions have
677-
been used:
619+
Let us also ask GROMACS to print the trajectory in a compressed **.xtc** file
620+
every 1000 steps, or every 1 ps, by adding the following line to **nvt.mdp**:
678621

679622
.. code-block:: bw
680623
681-
(...)
682-
; Method for doing electrostatics
683-
coulombtype = Cut-off
684-
(...)
685-
686-
For this system, computing the long-range Coulomb interactions is necessary,
687-
because electrostatic forces between charged particles decay slowly,
688-
as the inverse of the square of the distance between them, :math:`1/r^2`.
624+
nstlog = 100
625+
nstenergy = 100
626+
nstxout-compressed = 1000
689627
690-
In addition, the thermostating of the system should be improved, given that
691-
the temperature of the system is slightly larger than the desired temperature.
692-
For instance, separate thermostats can be applied to the water molecules
693-
and the ions.
628+
Here, we also request gromacs to print thermodynamic information
629+
in the log file and in the energy file **.edr** every 100 steps.
694630

695-
Let us improve the input used for the NVT step.
696-
First, in the *nvt.mdp* file, let us impose the calculation of long-range
697-
electrostatic, by the use of the
698-
long-range fast smooth particle-mesh ewald (SPME)
631+
Let us impose the calculation of long-range
632+
electrostatic, by the use of the long-range fast smooth particle-mesh ewald (SPME)
699633
electrostatics with Fourier spacing of :math:`0.1~\text{nm}`, order
700-
of 4, and cut-off of :math:`1~\text{nm}` :cite:`darden1993particle, essmann1995smooth`:
634+
of 4, and cut-off of :math:`1~\text{nm}` :cite:`darden1993particle, essmann1995smooth`.
635+
Let us also impose how the short-range van der Waals interactions
636+
should be treated by GROMACS, as well as the cut-off ``rvdw`` of :math:`1~\text{nm}`:
701637

702638
.. code-block:: bw
703639
640+
vdw-type = Cut-off
641+
rvdw = 1.0
642+
704643
coulombtype = pme
705644
fourierspacing = 0.1
706645
pme-order = 4
707646
rcoulomb = 1.0
708647
648+
For this system, computing the long-range Coulomb interactions is necessary,
649+
because electrostatic forces between charged particles decay slowly,
650+
as the inverse of the square of the distance between them, :math:`1/r^2`.
651+
709652
Here, the cut-off *rcoulomb* separates the short-range interactions from the
710653
long-range interactions. Long-range interactions are treated in the
711654
reciprocal space, while short-range interactions are computed directly.
712655

713-
Let us also impose how the short-range van der Waals interactions
714-
should be treated by GROMACS, as well as the cut-off *rvdw*
715-
of :math:`1~\text{nm}`:
716-
717-
.. code-block:: bw
718-
719-
vdw-type = Cut-off
720-
rvdw = 1.0
721-
722656
Let us use the LINCS algorithm to constrain the hydrogen
723657
bonds :cite:`hess1997lincs`. The water
724658
molecules will thus be treated as rigid, which is generally better given
@@ -730,59 +664,66 @@ the fast vibration of the hydrogen bonds.
730664
constraints = hbonds
731665
continuation = no
732666
733-
Let us also use separate temperature baths for
734-
the water molecules and the ions. Here, the ions are included
735-
in the default GROMACS group called *non-water*.
736-
Within *nvt.mdp*, replace the following lines:
737-
738-
.. code-block:: bw
739-
740-
tcoupl = v-rescale
741-
ref-t = 360
742-
tc-grps = system
743-
tau-t = 0.5
744-
745-
by:
667+
Let us also control the temperature throughout the
668+
simulation using the so-called ``v-rescale`` thermostat, which is
669+
a Berendsen thermostat with an additional stochastic term :cite:`bussi2007canonical`:
746670

747671
.. code-block:: bw
748672
749673
tcoupl = v-rescale
674+
ld-seed = 48456
750675
tc-grps = Water non-Water
751676
tau-t = 0.5 0.5
752677
ref-t = 360 360
753678
679+
The ``v-rescale`` thermostat is known to give a proper canonical
680+
ensemble. Here, we also specified that the thermostat is
681+
applied to the entire system using the ``tc-grps`` option and that the
682+
damping constant for the thermostat, ``tau-t``, is equal to 0.5 ps.
683+
684+
Here, two separate temperature baths for
685+
the water molecules and the ions are used. Here, the ions are included
686+
in the default GROMACS group called *non-water*.
754687
Now, the same temperature :math:`T = 360 ~ \text{K}` is imposed to the
755688
two groups with the same characteristic time :math:`\tau = 0.5 ~ \text{ps}`.
756-
757-
Let us also specify the neighbor searching parameters:
689+
690+
Note that the relatively high temperature of :math:`360~\text{K}`
691+
has been chosen here to reduce the viscosity of the solution and
692+
decrease the equilibration duration.
693+
694+
We now have a minimalist input file for performing
695+
the first :math:`NVT` simulation. Run it by typing in the terminal:
758696

759697
.. code-block:: bw
760698
761-
cutoff-scheme = Verlet
762-
nstlist = 10
763-
ns_type = grid
699+
gmx grompp -f inputs/nvt.mdp -c min.gro -o nvt -pp nvt -po nvt
700+
gmx mdrun -v -deffnm nvt
764701
765-
Let us give an initial kick to the atom so that the initial
766-
total velocities give the desired temperature of 360 K instead of 0 K
767-
as previously:
702+
Here ``-c min.gro`` option ensures that the previously
703+
minimized configuration is used as a starting point for the :math:`NVT` simulation.
704+
705+
After the completion of the simulation, we can
706+
ensure that the system temperature indeed reached
707+
the value of :math:`360~\text{K}` by using the energy command of
708+
GROMACS. In the terminal, type:
768709

769710
.. code-block:: bw
770711
771-
gen-vel = yes
772-
gen-temp = 360
712+
gmx energy -f nvt.edr -o nvt-T.xvg
773713
774-
Finally, let us cancel the translational of the center of mass
775-
of the system:
714+
and choose 10 for temperature, and then press enter twice.
776715

777-
.. code-block:: bw
716+
From the generated **nvt-T.xvg** file, one can see that temperature
717+
started from :math:`360~\text{K}`, as requested, then increase quicky
718+
due to the interaction between neighbor species. Thanks to the
719+
thermostat that is removing the extra energy from the system,
720+
the temperature reaches the requested temperature of
721+
:math:`360~\text{K}` after a duration of a few picoseconds.
778722

779-
comm_mode = linear
780-
comm_grps = system
723+
..
781724
782-
Run again GROMACS using this new input script. One difference with the
783-
previous (minimalist) NVT run is
784-
the temperature at the beginning of the run. The final
785-
temperature is also much closer to the desired temperature of 360 K.
725+
In general, it is better to perform a longer equilibration, but simulation
726+
durations are kept as short as possible for these tutorials.
786727

787728
.. figure:: ../figures/level1/bulk-solution/temperature-nvt-light.png
788729
:alt: Gromacs tutorial : temperature versus time.
@@ -794,8 +735,8 @@ temperature is also much closer to the desired temperature of 360 K.
794735

795736
.. container:: figurelegend
796737

797-
Figure: Evolution of the temperature as a function of the time
798-
during the NVT equilibration.
738+
Figure: Evolution of the temperature, :math:`T`, as a function of the time, :math:`t`
739+
during the :math:`NVT` molecular dynamics simulation.
799740

800741
Adjust the density using NPT
801742
============================

0 commit comments

Comments
 (0)