Skip to content

Commit f50dd76

Browse files
committed
improved tutorial 1
1 parent ffb50db commit f50dd76

File tree

7 files changed

+52
-43
lines changed

7 files changed

+52
-43
lines changed

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

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _bulk-solution-label:
22

3-
Bulk salt solution
4-
******************
3+
Ionic solution
4+
**************
55

66
.. container:: hatnote
77

@@ -207,9 +207,12 @@ The final **conf.gro** file contains :
207207
818Sol MW1 3242 1.130 0.170 2.960
208208
3.50000 3.50000 3.50000
209209
210-
The molecules and ions have been placed randomly in space, and
211-
are therefore arranged in a quite unrealistic manner. This will be
212-
fixed during energy minimization.
210+
The molecules and ions have been placed randomly in space, and are
211+
therefore arranged in a rather unrealistic manner. For instance, molecules
212+
should be oriented away from ions based on their charge, which is not the
213+
case, as can be seen using VMD. This will be corrected during energy
214+
minimization, where the residues will be moved and rotated according to the
215+
forces exerted by their surroundings.
213216

214217
.. figure:: figures/populate-box.png
215218
:alt: Gromacs configuration SO4 Na ions visualized with VMD
@@ -221,9 +224,12 @@ fixed during energy minimization.
221224

222225
.. container:: figurelegend
223226

224-
Figure: :math:`\text{SO}_4^{2-}` ions, :math:`\text{Na}_+` ions, and water molecules.
225-
Oxygen atoms are in red, hydrogen in white, sodium in blue, and sulfur in
226-
yellow. For easier visualization, water molecules are represented as sticks.
227+
Figure: (Left) Full system showing the :math:`\text{SO}_4^{2-}` ions, the
228+
:math:`\text{Na}_+` ions, and the water molecules, with oxygen atoms in red,
229+
hydrogen in white, sodium in blue, and sulfur in yellow. For easier
230+
visualization, water molecules are represented as sticks. (Right) Zoom-in on
231+
a single :math:`\text{Na}_+` ion and a single :math:`\text{SO}_4^{2-}`, as well
232+
as the surrounding water molecules.
227233

228234
Set the parameters
229235
==================
@@ -488,15 +494,13 @@ using VMD by typing in the terminal:
488494
489495
vmd conf.gro min.trr
490496
491-
.. figure:: figures/solution-light.webp
497+
.. figure:: figures/minimisation.webp
492498
:alt: Gromacs tutorial : Movie showing the motion of the atoms during the energy minimization.
493499
:class: only-light
494-
:height: 330
495500

496-
.. figure:: figures/solution-dark.webp
501+
.. figure:: figures/minimisation-dm.webp
497502
:alt: Gromacs tutorial : Movie showing the motion of the atoms during the energy minimization.
498503
:class: only-dark
499-
:height: 330
500504

501505
.. container:: figurelegend
502506

@@ -895,38 +899,41 @@ at equilibrium temperature and pressure, **npt.gro**, using:
895899
Measurement
896900
===========
897901

898-
After completing the simulation, we proceed to compute the radial distribution functions (rdf):
902+
After completing the simulation, we proceed to compute the radial distribution
903+
functions (RDF):
899904

900905
.. math::
901906
902907
g(r) = \frac{V}{N_{\text{ref}} \rho} \frac{dN(r)}{dr},
903908
909+
904910
where :math:`V` is the volume of the simulation box, :math:`N_{\text{ref}}` is
905911
the number of reference atoms, :math:`\rho` is the average number density of
906912
particles in the system, and :math:`\frac{dN(r)}{dr}` is the number of particles
907913
in a spherical shell of thickness :math:`dr` around a reference particle at
908-
a distance :math:`r`.
914+
distance :math:`r`.
915+
916+
First, let us measure the RDF between :math:`\text{Na}^+` ions and
917+
:math:`\text{H}_2\text{O}` molecules, as well as between :math:`\text{SO}_4^{2-}`
918+
ions and :math:`\text{H}_2\text{O}` molecules. This can be done using the
919+
``gmx rdf`` command as follows:
909920

910-
First, let us measure the rdf between :math:`\text{Na}^+`
911-
ions and :math:`\text{H}_2\text{O}` molecules, as well as between :math:`\text{SO}_4^{2-}`
912-
ions and :math:`\text{H}_2\text{O}`. This can be done using
913-
the ``gmx rdf`` command as follows:
914-
915921
.. code-block:: bw
916922
917923
gmx rdf -f production.xtc -s production.tpr -o production-rdf-na-h2o.xvg
918924
919-
Then select the sodium ions as *reference* by typing 3, the water
920-
as *selection* by typing 4, and press ``Ctrl+D``. The same can be done
921-
for :math:`\text{SO}_4^{2-}` ions by typing:
925+
Then select the sodium ions as *reference* by typing 3, the water as
926+
*selection* by typing 4, and press ``Ctrl+D``. The same can be done for
927+
:math:`\text{SO}_4^{2-}` ions by typing:
922928

923-
.. code-block:: bw
929+
.. code-block:: bw
924930
925931
${gmx} rdf -f production.xtc -s production.tpr -o production-rdf-so4-h2o.xvg
926932
927933
and then by typing 2 and 4.
928934

929-
The results show...
935+
The results show multiple peaks, corresponding to the most likely distances
936+
between the ions and the water molecules.
930937

931938
.. figure:: figures/rdf-plain.png
932939
:alt: Gromacs tutorial RDF radial distribution function
@@ -938,19 +945,20 @@ The results show...
938945

939946
.. container:: figurelegend
940947

941-
Figure: Radial distribution functions (RDF) as calculated between sodium
942-
and water (:math:`\text{Na}^+ - \text{H}_2\text{O}`), between sulfate and
948+
Figure: Radial distribution functions (RDF) calculated between sodium and
949+
water (:math:`\text{Na}^+ - \text{H}_2\text{O}`), and between sulfate and
943950
water (:math:`\text{SO}_4^{2-} - \text{H}_2\text{O}`).
944951

945-
The main issue with the calculated rdf, is that it includes all the atoms from
946-
thr :math:`\text{H}_2\text{O}` molecules (including the hydrogen atoms) and all
947-
the atoms from the :math:`\text{SO}_4^{2-}`, leading to more peaks and dephts
948-
and a more difficult analysis. Rdfs would be easiers to interpret, if only the
949-
water oxygen atoms (with name ``OW1``) and :math:`\text{SO}_4^{2-}` ions
950-
sulfur atoms (with name ``S1``) where included in the analysis. As these groups were not
951-
included in the original group, we have to create them ourself.
952+
The main issue with the calculated RDFs is that they includes all the atoms from
953+
the :math:`\text{H}_2\text{O}` molecules (including the hydrogen atoms) and all
954+
the atoms from the :math:`\text{SO}_4^{2-}` ions, leading to more peaks and
955+
depths, making analysis more difficult. RDFs would be easier to interpret if
956+
only the water oxygen atoms (with name ``OW1``) and the sulfur atoms of the
957+
:math:`\text{SO}_4^{2-}` ions (with name ``S1``) were included in the analysis.
952958

953-
To create groups, we can use the ``gmx make_ndx`` command as follow:
959+
Since these groups were not included in the original GROMACS group, we need to
960+
create them ourselves. To create groups, we can use the ``gmx make_ndx`` command
961+
as follows:
954962

955963
.. code-block:: bw
956964
@@ -960,9 +968,9 @@ To create groups, we can use the ``gmx make_ndx`` command as follow:
960968
q
961969
EOF
962970
963-
And then type ``a OW1`` and press enter, ``a S1`` and press enter, and then
964-
press ``q`` to save and quit. This will create a file name **index.ndx** that
965-
contain two more groups (named OW1 and S1) alongside the default ones:
971+
Then type ``a OW1`` and press enter, ``a S1`` and press enter, and finally
972+
press ``q`` to save and quit. This will create a file named **index.ndx** that
973+
contains two additional groups (named OW1 and S1) alongside the default ones:
966974

967975
.. code-block:: bw
968976
@@ -982,7 +990,7 @@ contain two more groups (named OW1 and S1) alongside the default ones:
982990
[ S1 ]
983991
5 10 15 20 25 30
984992
985-
Then, let us rerun the ``gmx rdf`` command using the **index.ndx** file, and
993+
Then, let us rerun the ``gmx rdf`` command using the **index.ndx** file and
986994
selecting the newly created groups:
987995

988996
.. code-block:: bw
@@ -995,7 +1003,8 @@ and select 3 and 7.
9951003
9961004
gmx rdf -f production.xtc -s production.tpr -o production-rdf-so4-OW1.xvg -n index.ndx
9971005
998-
and select 8 and 7.
1006+
and select 8 and 7. As can be seen by plotting the generated **.xvg** files, the RDF
1007+
is much cleaner now that we have selected the atoms of interest.
9991008

10001009
.. figure:: figures/rdf-filtered.png
10011010
:alt: Gromacs tutorial RDF radial distribution function
@@ -1007,10 +1016,10 @@ and select 8 and 7.
10071016

10081017
.. container:: figurelegend
10091018

1010-
Figure: Radial distribution functions (RDF) as calculated between sodium
1011-
and water oxygens (:math:`\text{Na}^+ - \text{OW1}`), between sulfur and
1012-
water oxygens (:math:`\text{S1} - \text{OW1}`), and in between water oxygens
1013-
(:math:`\text{OW1} - \text{OW1}`),.
1019+
Figure: Radial distribution functions (RDF) calculated between sodium and
1020+
water oxygens (:math:`\text{Na}^+ - \text{OW1}`), between sulfur and
1021+
water oxygens (:math:`\text{S1} - \text{OW1}`), and between water oxygens
1022+
(:math:`\text{OW1} - \text{OW1}`).
10141023

10151024
The radial distribution functions highlight the typical distance between
10161025
the different species of the fluid. For instance, it can be seen that
-431 KB
Loading
-374 KB
Loading
1.83 MB
Loading
2.28 MB
Loading
23.1 KB
Loading
35.1 KB
Loading

0 commit comments

Comments
 (0)