Merge branch 'master' of git://git.gromacs.org/gromacs
[gromacs/adressmacs.git] / share / html / online / water.html
bloba589330daadb0467e4b919b0084cfbe4e387e643
1 <HTML>
2 <HEAD>
3 <TITLE>Getting started - Water</TITLE>
4 <LINK rel=stylesheet href="style.css" type="text/css">
5 <BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
6 <TABLE WIDTH="98%" NOBORDER >
7 <TR><TD WIDTH=400>
8 <TABLE WIDTH=400 NOBORDER>
9 <TD WIDTH=116>
10 <a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.jpg"BORDER=0 height=133 width=116></a></td>
11 <td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>Getting started - Water</h2>
12 <font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
13 </TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.0<br>
14 Sun 18 Jan 2009</B></td></tr></TABLE>
15 <HR>
17 <P><H2><A NAME="water">Water</A></H2>
18 Now you are going to simulate 216 molecules of SPC water
19 (<A HREF="getting_started.html#berendsen81">Berendsen <it>et al.</it>, 1981</A>)
20 in a cubic box. In this example the GROMACS
21 software team already generated most of the neccesary input
22 files. The files needed in this example are:
23 <ul>
24 <LI> Initial structure of a box of 216 water molecules (<TT><a href="gro.html">.gro</a></TT>)</li>
26 <LI> Topology file of water (<tt><a href="top.html">.top</a></tt>)</li>
27 <LI> Molecular Dynamics parameter file (<TT><a href="mdp_opt.html">.mdp</a></TT>)</li>
28 </ul>
29 <P>
30 Change your directory to <tt>tutor/water </tt>:
31 <br><br>
32 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
33 <tr NOSAVE>
34 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
35 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
37 <tt> cd tutor/water</tt>
38 <td></td>
39 </tr>
40 </table>
41 <br>
42 Let's first have a look at the coordinate file:
43 <br><br>
44 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
45 <tr NOSAVE>
46 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
47 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
49 <tt> more conf.gro
50 </tt>
51 <td></td>
52 </tr>
53 </table>
54 <br>
55 Or to view the water box graphically:
56 <br><br>
57 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
58 <tr NOSAVE>
59 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
60 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
62 <tt> rasmol spc216.pdb
63 </tt>
64 <td></td>
65 </tr>
66 </table>
67 <br>
69 Have a look at the topology file:
70 <br><br>
71 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
72 <tr NOSAVE>
73 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
74 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
76 <tt> more topol.top
77 </tt>
78 <td></td>
79 </tr>
80 </table>
81 <br>
83 Have a look at the <a href="mdp_opt.html">MD-parameters file</a>:
84 <br><br>
85 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
86 <tr NOSAVE>
87 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
88 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
90 <tt> more grompp.mdp
91 </tt>
92 <td></td>
93 </tr>
94 </table>
95 <br>
97 Since all the neccesary files are available, we are going to
98 preprocess the input files to create a run input
99 (<TT><a href="tpr.html">.tpr</a></TT>) file.
100 This run input file is the only input file for the
101 MD-program <TT><a href="mdrun.html">mdrun</a></TT>.
102 <br><br>
103 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
104 <tr NOSAVE>
105 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
106 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
108 <tt> grompp -v
109 </tt>
110 <td></td>
111 </tr>
112 </table>
113 <br>
115 The run input file is only viewable with the program
116 <TT><a href="gmxdump.html">gmxdump</a></TT>.
117 In this way it is possible to check if the preprocessor
118 <TT><a href="grompp.html">grompp</a></TT> worked well.
119 The output may seem rather cryptic, so don't panic when you don't
120 understand every single item in it.
121 <br><br>
122 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
123 <tr NOSAVE>
124 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
125 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
127 <tt> gmxdump -s topol.tpr | more
128 </tt>
129 <td></td>
130 </tr>
131 </table>
132 <br>
134 Now it's time to start the simulation of 20 picoseconds.
135 <br><br>
136 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
137 <tr NOSAVE>
138 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
139 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
141 <tt> mdrun -v
142 </tt>
143 <td></td>
144 </tr>
145 </table>
146 <br>
148 After the MD simulation is finished, it is possible to view the
149 trajectory with the <a href="ngmx.html">ngmx</a> program:
150 <br><br>
151 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
152 <tr NOSAVE>
153 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
154 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
156 <tt> ngmx
157 </tt>
158 <td></td>
159 </tr>
160 </table>
161 <br>
164 When the program starts, you must select a group of atoms to view. In
165 our case that will be "SOL" (for solvent) or "System", which is the
166 same for a box of water as we have. Select one and click OK. Then
167 select Display->Animate from the menu. Use the buttons to see your
168 water moving (note: "Play" steps one frame forward; "Fast Forward"
169 plays; "Rewind" skips back to the beginning of the trajectory).
170 </P>
172 <hr>
173 <h2>Analysis of the simulation</h2>
174 <ol>
175 <li><p>
176 Calculate a radial distribution function of the Oxygen atoms. The
177 index file <TT><a href="ndx.html">index.ndx</a></TT>
178 contains one group with all the oxygen atoms.
179 <br><br>
180 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
181 <tr NOSAVE>
182 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
183 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
185 <tt> g_rdf -n index
186 </tt>
187 <td></td>
188 </tr>
189 </table>
190 <br>
191 The program will ask you for how many groups you want the calculate
192 the RDF, answer 1. Now,
193 view the output graph of <TT><a href="g_rdf.html">g_rdf</a></TT>.
194 The file is already prepared to produce a nice graph in the
195 <tt>xmgrace</tt> program.
196 <br><br>
197 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
198 <tr NOSAVE>
199 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
200 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
202 <tt> xmgrace rdf.xvg
203 </tt>
204 <td></td>
205 </tr>
206 </table>
207 <br>
208 Which shows you the radial distribution function for Oxygen-Oxygen in
209 SPC water. The first peak is at roughly 0.28 nm, and has a height of 2.8.
210 This means that the relative density of oxygen atoms in water,
211 is almost 3 times higher at a distance of 0.28 nm from another oxygen atom.
212 Obviously this is due to strong hydrogen bonding in liquid water.
213 </P></li>
215 <li><p>
216 We can also do a direct analysis of the number of hydrogen bonds in
217 liquid water, based on O-O distance and O-H ... O angle.
218 <br><br>
219 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
220 <tr NOSAVE>
221 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
222 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
224 <tt> g_hbond
225 </tt>
226 <td></td>
227 </tr>
228 </table>
229 <br>
230 Select twice 0, when asked. Check the output with
231 <br><br>
232 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
233 <tr NOSAVE>
234 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
235 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
237 <tt> xmgrace hbnum.xvg
238 </tt>
239 <td></td>
240 </tr>
241 </table>
242 <br>
243 <font color="red">What is the number of hydrogen bonds per water
244 molecule? What is the maximum possible number?</font>
245 </p></li>
247 <li><p>
248 As a further test of the simulation we will compute the self diffusion constant
249 of water. This can be computed from the <b>Mean square displacement</b> (MSD)
250 function. The MSD determines how much on average a molecule has moved
251 with time. After a certain time period there is no correlation between the
252 starting position and the current position and the square displacement will
253 be linear with time. The slope of the MSD function is the linearly proportional
254 to the self diffusion constant.
255 <br><br>
256 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
257 <tr NOSAVE>
258 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
259 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
261 <tt> g_msd -n index
262 </tt>
263 <td></td>
264 </tr>
265 </table>
266 <br>
267 View the output
268 <br><br>
269 <table BORDER=0 CELLSPACING=0 CELLPADDING=8 COLS=3 WIDTH="100%" NOSAVE >
270 <tr NOSAVE>
271 <td WIDTH="2%" NOSAVE><font color="#000000"></font></td>
272 <td WIDTH="80%" BGCOLOR="#000066" NOSAVE><font color="#FFFFFF">
274 <tt> xmgrace msd.xvg
275 </tt>
276 <td></td>
277 </tr>
278 </table>
279 <br>
280 Check that the graph is roughly linear. The <tt>g_msd</tt> program also
281 computes the diffusion constant D for you. The experimental value
282 is roughly 2.3 x 10<sup>-5</sup> cm<sup>2</sup>/s. The simulation
283 result is clearly too high, due to the simplicity of the model.
284 </p></li>
285 </ol>
287 <hr>
288 <a href="methanol.html"><h3>Go to the next step</h3></a>
289 <hr>
291 </BODY>
292 </HTML>