ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/oopsePaper/Mechanics.tex
Revision: 1082
Committed: Wed Mar 3 23:16:18 2004 UTC (21 years, 2 months ago) by gezelter
Content type: application/x-tex
File size: 37228 byte(s)
Log Message:
NPTf complete, NPTxyz complete

File Contents

# Content
1
2 \section{\label{sec:mechanics}Mechanics}
3
4 \subsection{\label{integrate}Integrating the Equations of Motion: the
5 DLM method}
6
7 The default method for integrating the equations of motion in {\sc
8 oopse} is a velocity-Verlet version of the symplectic splitting method
9 proposed by Dullweber, Leimkuhler and McLachlan
10 (DLM).\cite{Dullweber1997} When there are no directional atoms or
11 rigid bodies present in the simulation, this integrator becomes the
12 standard velocity-Verlet integrator which is known to sample the
13 microcanonical (NVE) ensemble.\cite{}
14
15 Previous integration methods for orientational motion have problems
16 that are avoided in the DLM method. Direct propagation of the Euler
17 angles has a known $1/\sin\theta$ divergence in the equations of
18 motion for $\phi$ and $\psi$,\cite{AllenTildesley} leading to
19 numerical instabilities any time one of the directional atoms or rigid
20 bodies has an orientation near $\theta=0$ or $\theta=\pi$. More
21 modern quaternion-based integration methods have relatively poor
22 energy conservation. While quaternions work well for orientational
23 motion in other ensembles, the microcanonical ensemble has a
24 constant energy requirement that is quite sensitive to errors in the
25 equations of motion. An earlier implementation of {\sc oopse}
26 utilized quaternions for propagation of rotational motion; however, a
27 detailed investigation showed that they resulted in a steady drift in
28 the total energy, something that has been observed by
29 Laird {\it et al.}\cite{Laird97}
30
31 The key difference in the integration method proposed by Dullweber
32 \emph{et al.} is that the entire $3 \times 3$ rotation matrix is
33 propagated from one time step to the next. In the past, this would not
34 have been feasible, since the rotation matrix for a single body has
35 nine elements compared with the more memory-efficient methods (using
36 three Euler angles or 4 quaternions). Computer memory has become much
37 less costly in recent years, and this can be translated into
38 substantial benefits in energy conservation.
39
40 The basic equations of motion being integrated are derived from the
41 Hamiltonian for conservative systems containing rigid bodies,
42 \begin{equation}
43 H = \sum_{i} \left( \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i +
44 \frac{1}{2} {\bf j}_i^T \cdot \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot
45 {\bf j}_i \right) +
46 V\left(\left\{{\bf r}\right\}, \left\{\mathsf{A}\right\}\right)
47 \end{equation}
48 where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector
49 and velocity of the center of mass of particle $i$, and ${\bf j}_i$
50 and $\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular
51 momentum and moment of inertia tensor, respectively. $\mathsf{A}_i$
52 is the $3 \times 3$ rotation matrix describing the instantaneous
53 orientation of the particle. $V$ is the potential energy function
54 which may depend on both the positions $\left\{{\bf r}\right\}$ and
55 orientations $\left\{\mathsf{A}\right\}$ of all particles. The
56 equations of motion for the particle centers of mass are derived from
57 Hamilton's equations and are quite simple,
58 \begin{eqnarray}
59 \dot{{\bf r}} & = & {\bf v} \\
60 \dot{{\bf v}} & = & \frac{{\bf f}}{m}
61 \end{eqnarray}
62 where ${\bf f}$ is the instantaneous force on the center of mass
63 of the particle,
64 \begin{equation}
65 {\bf f} = - \frac{\partial}{\partial
66 {\bf r}} V(\left\{{\bf r}(t)\right\}, \left\{\mathsf{A}(t)\right\}).
67 \end{equation}
68
69 The equations of motion for the orientational degrees of freedom are
70 \begin{eqnarray}
71 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
72 \mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right) \\
73 \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1}
74 \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
75 V}{\partial \mathsf{A}} \right)
76 \end{eqnarray}
77 In these equations of motion, the $\mbox{skew}$ matrix of a vector
78 ${\bf v} = \left( v_1, v_2, v_3 \right)$ is defined:
79 \begin{equation}
80 \mbox{skew}\left( {\bf v} \right) := \left(
81 \begin{array}{ccc}
82 0 & v_3 & - v_2 \\
83 -v_3 & 0 & v_1 \\
84 v_2 & -v_1 & 0
85 \end{array}
86 \right)
87 \end{equation}
88 The $\mbox{rot}$ notation refers to the mapping of the $3 \times 3$
89 rotation matrix to a vector of orientations by first computing the
90 skew-symmetric part $\left(\mathsf{A} - \mathsf{A}^{T}\right)$ and
91 then associating this with a length 3 vector by inverting the
92 $\mbox{skew}$ function above:
93 \begin{equation}
94 \mbox{rot}\left(\mathsf{A}\right) := \mbox{ skew}^{-1}\left(\mathsf{A}
95 - \mathsf{A}^{T} \right)
96 \end{equation}
97 Written this way, the $\mbox{rot}$ operation creates a set of
98 conjugate angle coordinates to the body-fixed angular momenta
99 represented by ${\bf j}$. This equation of motion for angular momenta
100 is equivalent to the more familiar body-fixed forms,
101 \begin{eqnarray}
102 \dot{j_{x}} & = & \tau^b_x(t) +
103 \left(\overleftrightarrow{\mathsf{I}}_{yy} - \overleftrightarrow{\mathsf{I}}_{zz} \right) j_y j_z \\
104 \dot{j_{y}} & = & \tau^b_y(t) +
105 \left(\overleftrightarrow{\mathsf{I}}_{zz} - \overleftrightarrow{\mathsf{I}}_{xx} \right) j_z j_x \\
106 \dot{j_{z}} & = & \tau^b_z(t) +
107 \left(\overleftrightarrow{\mathsf{I}}_{xx} - \overleftrightarrow{\mathsf{I}}_{yy} \right) j_x j_y
108 \end{eqnarray}
109 which utilize the body-fixed torques, ${\bf \tau}^b$. Torques are
110 most easily derived in the space-fixed frame,
111 \begin{equation}
112 {\bf \tau}^b(t) = \mathsf{A}(t) \cdot {\bf \tau}^s(t)
113 \end{equation}
114 where the torques are either derived from the forces on the
115 constituent atoms of the rigid body, or for directional atoms,
116 directly from derivatives of the potential energy,
117 \begin{equation}
118 {\bf \tau}^s(t) = - \hat{\bf u}(t) \times \left( \frac{\partial}
119 {\partial \hat{\bf u}} V\left(\left\{ {\bf r}(t) \right\}, \left\{
120 \mathsf{A}(t) \right\}\right) \right).
121 \end{equation}
122 Here $\hat{\bf u}$ is a unit vector pointing along the principal axis
123 of the particle in the space-fixed frame.
124
125 The DLM method uses a Trotter factorization of the orientational
126 propagator. This has three effects:
127 \begin{enumerate}
128 \item the integrator is area-preserving in phase space (i.e. it is
129 {\it symplectic}),
130 \item the integrator is time-{\it reversible}, making it suitable for Hybrid
131 Monte Carlo applications, and
132 \item the error for a single time step is of order $O\left(h^3\right)$
133 for timesteps of length $h$.
134 \end{enumerate}
135
136 The integration of the equations of motion is carried out in a
137 velocity-Verlet style 2-part algorithm:
138
139 {\tt moveA:}
140 \begin{eqnarray}
141 {\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf
142 v}(t) + \frac{\delta t}{2} \left( {\bf f}(t) / m \right) \\
143 {\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf
144 v}\left(t + \delta t / 2 \right) \\
145 {\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf
146 j}(t) + \frac{\delta t}{2} {\bf \tau}^b(t) \\
147 \mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left( \delta t
148 {\bf j}(t + \delta t / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1}
149 \right)
150 \end{eqnarray}
151
152 In this context, the $\mathrm{rot}$ function is the reversible product
153 of the three body-fixed rotations,
154 \begin{equation}
155 \mathrm{rot}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot
156 \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y /
157 2) \cdot \mathsf{G}_x(a_x /2)
158 \end{equation}
159 where each rotational propagator, $\mathsf{G}_\alpha(\theta)$, rotates
160 both the rotation matrix ($\mathsf{A}$) and the body-fixed angular
161 momentum (${\bf j}$) by an angle $\theta$ around body-fixed axis
162 $\alpha$,
163 \begin{equation}
164 \mathsf{G}_\alpha( \theta ) = \left\{
165 \begin{array}{lcl}
166 \mathsf{A}(t) & \leftarrow & \mathsf{A}(0) \cdot \mathsf{R}_\alpha(\theta)^T \\
167 {\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf j}(0)
168 \end{array}
169 \right.
170 \end{equation}
171 $\mathsf{R}_\alpha$ is a quadratic approximation to
172 the single-axis rotation matrix. For example, in the small-angle
173 limit, the rotation matrix around the body-fixed x-axis can be
174 approximated as
175 \begin{equation}
176 \mathsf{R}_x(\theta) \approx \left(
177 \begin{array}{ccc}
178 1 & 0 & 0 \\
179 0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+
180 \theta^2 / 4} \\
181 0 & \frac{\theta}{1+
182 \theta^2 / 4} & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4}
183 \end{array}
184 \right).
185 \end{equation}
186 All other rotations follow in a straightforward manner.
187
188 After the first part of the propagation, the forces and body-fixed
189 torques are calculated at the new positions and orientations
190
191 {\tt doForces:}
192 \begin{eqnarray}
193 {\bf f}(t + \delta t) & \leftarrow & - \left(\frac{\partial V}{\partial {\bf
194 r}}\right)_{{\bf r}(t + \delta t)} \\
195 {\bf \tau}^{s}(t + \delta t) & \leftarrow & {\bf u}(t + \delta t)
196 \times \frac{\partial V}{\partial {\bf u}} \\
197 {\bf \tau}^{b}(t + \delta t) & \leftarrow & \mathsf{A}(t + \delta t)
198 \cdot {\bf \tau}^s(t + \delta t)
199 \end{eqnarray}
200
201 {\sc oopse} automatically updates ${\bf u}$ when the rotation matrix
202 $\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and
203 torques have been obtained at the new time step, the velocities can be
204 advanced to the same time value.
205
206 {\tt moveB:}
207 \begin{eqnarray}
208 {\bf v}\left(t + \delta t \right) & \leftarrow & {\bf
209 v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left(
210 {\bf f}(t + \delta t) / m \right) \\
211 {\bf j}\left(t + \delta t \right) & \leftarrow & {\bf
212 j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} {\bf
213 \tau}^b(t + \delta t)
214 \end{eqnarray}
215
216 The matrix rotations used in the DLM method end up being more costly
217 computationally than the simpler arithmetic quaternion
218 propagation. With the same time step, a 1000-molecule water simulation
219 shows an average 7\% increase in computation time using the DLM method
220 in place of quaternions. This cost is more than justified when
221 comparing the energy conservation of the two methods as illustrated in
222 figure \ref{timestep}.
223
224 \begin{figure}
225 \epsfxsize=6in
226 \epsfbox{timeStep.epsi}
227 \caption{Energy conservation using quaternion based integration versus
228 the method proposed by Dullweber \emph{et al.} with increasing time
229 step. For each time step, the dotted line is total energy using the
230 DLM integrator, and the solid line comes from the quaternion
231 integrator. The larger time step plots are shifted up from the true
232 energy baseline for clarity.}
233 \label{timestep}
234 \end{figure}
235
236 In figure \ref{timestep}, the resulting energy drift at various time
237 steps for both the DLM and quaternion integration schemes is
238 compared. All of the 1000 molecule water simulations started with the
239 same configuration, and the only difference was the method for
240 handling rotational motion. At time steps of 0.1 and 0.5 fs, both
241 methods for propagating molecule rotation conserve energy fairly well,
242 with the quaternion method showing a slight energy drift over time in
243 the 0.5 fs time step simulation. At time steps of 1 and 2 fs, the
244 energy conservation benefits of the DLM method are clearly
245 demonstrated. Thus, while maintaining the same degree of energy
246 conservation, one can take considerably longer time steps, leading to
247 an overall reduction in computation time.
248
249 There is only one specific keyword relevant to the default integrator,
250 and that is the time step for integrating the equations of motion.
251
252 \begin{center}
253 \begin{tabular}{llll}
254 {\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf
255 default value} \\
256 $\delta t$ & {\tt dt = 2.0;} & fs & none
257 \end{tabular}
258 \end{center}
259
260 \subsection{\label{sec:extended}Extended Systems for other Ensembles}
261
262 {\sc oopse} implements a number of extended system integrators for
263 sampling from other ensembles relevant to chemical physics. The
264 integrator can selected with the {\tt ensemble} keyword in the
265 {\tt .bass} file:
266
267 \begin{center}
268 \begin{tabular}{lll}
269 {\bf Integrator} & {\bf Ensemble} & {\bf {\tt .bass} line} \\
270 NVE & microcanonical & {\tt ensemble = ``NVE''; } \\
271 NVT & canonical & {\tt ensemble = ``NVT''; } \\
272 NPTi & isobaric-isothermal (with isotropic volume changes) & {\tt
273 ensemble = ``NPTi'';} \\
274 NPTf & isobaric-isothermal (with changes to box shape) & {\tt
275 ensemble = ``NPTf'';} \\
276 NPTxyz & approximate isobaric-isothermal & {\tt ensemble =
277 ``NPTxyz'';} \\
278 & (with separate barostats on each box dimension) &
279 \end{tabular}
280 \end{center}
281
282 The relatively well-known Nos\'e-Hoover thermostat is implemented in
283 {\sc oopse}'s NVT integrator. This method couples an extra degree of
284 freedom (the thermostat) to the kinetic energy of the system, and has
285 been shown to sample the canonical distribution in the system degrees
286 of freedom while conserving a quantity that is, to within a constant,
287 the Helmholtz free energy.
288
289 NPT algorithms attempt to maintain constant pressure in the system by
290 coupling the volume of the system to a barostat. {\sc oopse} contains
291 three different constant pressure algorithms. The first two, NPTi and
292 NPTf have been shown to conserve a quantity that is, to within a
293 constant, the Gibbs free energy. The Melchionna modification to the
294 Hoover barostat is implemented in both NPTi and NPTf. NPTi allows
295 only isotropic changes in the simulation box, while box {\it shape}
296 variations are allowed in NPTf. The NPTxyz integrator has {\it not}
297 been shown to sample from the isobaric-isothermal ensemble. It is
298 useful, however, in that it maintains orthogonality for the axes of
299 the simulation box while attempting to equalize pressure along the
300 three perpendicular directions in the box.
301
302 Each of the extended system integrators requires additional keywords
303 to set target values for the thermodynamic state variables that are
304 being held constant. Keywords are also required to set the
305 characteristic decay times for the dynamics of the extended
306 variables.
307
308 \begin{tabular}{llll}
309 {\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf
310 default value} \\
311 $T_{\mathrm{target}}$ & {\tt targetTemperature = 300;} & K & none \\
312 $P_{\mathrm{target}}$ & {\tt targetPressure = 1;} & atm & none \\
313 $\tau_T$ & {\tt tauThermostat = 1e3;} & fs & none \\
314 $\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\
315 & {\tt resetTime = 200;} & fs & none \\
316 & {\tt useInitialExtendedSystemState = ``true'';} & logical &
317 false
318 \end{tabular}
319
320 Two additional keywords can be used to either clear the extended
321 system variables periodically ({\tt resetTime}), or to maintain the
322 state of the extended system variables between simulations ({\tt
323 useInitialExtendedSystemState}). More details on these variables
324 and their use in the integrators follows below.
325
326 \subsubsection{\label{sec:noseHooverThermo}Nos\'{e}-Hoover Thermostatting}
327
328 The Nos\'e-Hoover equations of motion are given by\cite{Hoover85}
329 \begin{eqnarray}
330 \dot{{\bf r}} & = & {\bf v} \\
331 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} \\
332 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
333 \mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right) \\
334 \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1}
335 \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
336 V}{\partial \mathsf{A}} \right) - \chi {\bf j}
337 \label{eq:nosehoovereom}
338 \end{eqnarray}
339
340 $\chi$ is an ``extra'' variable included in the extended system, and
341 it is propagated using the first order equation of motion
342 \begin{equation}
343 \dot{\chi} = \frac{1}{\tau_{T}^2} \left( \frac{T}{T_{\mathrm{target}}} - 1 \right).
344 \label{eq:nosehooverext}
345 \end{equation}
346
347 The instantaneous temperature $T$ is proportional to the total kinetic
348 energy (both translational and orientational) and is given by
349 \begin{equation}
350 T = \frac{2 K}{f k_B}
351 \end{equation}
352 Here, $f$ is the total number of degrees of freedom in the system,
353 \begin{equation}
354 f = 3 N + 3 N_{\mathrm{orient}} - N_{\mathrm{constraints}}
355 \end{equation}
356 and $K$ is the total kinetic energy,
357 \begin{equation}
358 K = \sum_{i=1}^{N} \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i +
359 \sum_{i=1}^{N_{\mathrm{orient}}} \frac{1}{2} {\bf j}_i^T \cdot
360 \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot {\bf j}_i
361 \end{equation}
362
363 In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for
364 relaxation of the temperature to the target value. To set values for
365 $\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use the
366 {\tt tauThermostat} and {\tt targetTemperature} keywords in the {\tt
367 .bass} file. The units for {\tt tauThermostat} are fs, and the units
368 for the {\tt targetTemperature} are degrees K. The integration of
369 the equations of motion is carried out in a velocity-Verlet style 2
370 part algorithm:
371
372 {\tt moveA:}
373 \begin{eqnarray}
374 T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\
375 {\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf
376 v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
377 \chi(t)\right) \\
378 {\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf
379 v}\left(t + \delta t / 2 \right) \\
380 {\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf
381 j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
382 \chi(t) \right) \\
383 \mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t *
384 {\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\
385 \chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) +
386 \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1
387 \right)
388 \end{eqnarray}
389
390 Here $\mathrm{rot}(\delta t * {\bf j}
391 \overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic Trotter
392 factorization of the three rotation operations that was discussed in
393 the section on the DLM integrator. Note that this operation modifies
394 both the rotation matrix $\mathsf{A}$ and the angular momentum ${\bf
395 j}$. {\tt moveA} propagates velocities by a half time step, and
396 positional degrees of freedom by a full time step. The new positions
397 (and orientations) are then used to calculate a new set of forces and
398 torques in exactly the same way they are calculated in the {\tt
399 doForces} portion of the DLM integrator.
400
401 Once the forces and torques have been obtained at the new time step,
402 the temperature, velocities, and the extended system variable can be
403 advanced to the same time value.
404
405 {\tt moveB:}
406 \begin{eqnarray}
407 T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\},
408 \left\{{\bf j}(t + \delta t)\right\} \\
409 \chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t /
410 2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta
411 t)}{T_{\mathrm{target}}} - 1 \right) \\
412 {\bf v}\left(t + \delta t \right) & \leftarrow & {\bf
413 v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left(
414 \frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t)
415 \chi(t \delta t)\right) \\
416 {\bf j}\left(t + \delta t \right) & \leftarrow & {\bf
417 j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf
418 \tau}^b(t + \delta t) - {\bf j}(t + \delta t)
419 \chi(t + \delta t) \right)
420 \end{eqnarray}
421
422 Since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$ are required
423 to caclculate $T(t + \delta t)$ as well as $\chi(t + \delta t)$, they
424 indirectly depend on their own values at time $t + \delta t$. {\tt
425 moveB} is therefore done in an iterative fashion until $\chi(t +
426 \delta t)$ becomes self-consistent. The relative tolerance for the
427 self-consistency check defaults to a value of $\mbox{10}^{-6}$, but
428 {\sc oopse} will terminate the iteration after 4 loops even if the
429 consistency check has not been satisfied.
430
431 The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for the
432 extended system that is, to within a constant, identical to the
433 Helmholtz free energy,
434 \begin{equation}
435 H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left(
436 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
437 \right)
438 \end{equation}
439 Poor choices of $\delta t$ or $\tau_T$ can result in non-conservation
440 of $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the
441 last column of the {\tt .stat} file to allow checks on the quality of
442 the integration.
443
444 Bond constraints are applied at the end of both the {\tt moveA} and
445 {\tt moveB} portions of the algorithm. Details on the constraint
446 algorithms are given in section \ref{sec:rattle}.
447
448 \subsubsection{\label{sec:NPTi}Constant-pressure integration with
449 isotropic box deformations (NPTi)}
450
451 To carry out isobaric-isothermal ensemble calculations {\sc oopse}
452 implements the Melchionna modifications to the Nos\'e-Hoover-Andersen
453 equations of motion,\cite{Melchionna93}
454
455 \begin{eqnarray}
456 \dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right) \\
457 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v} \\
458 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
459 \mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) \\
460 \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1}
461 \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
462 V}{\partial \mathsf{A}} \right) - \chi {\bf j} \\
463 \dot{\chi} & = & \frac{1}{\tau_{T}^2} \left(
464 \frac{T}{T_{\mathrm{target}}} - 1 \right) \\
465 \dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( P -
466 P_{\mathrm{target}} \right) \\
467 \dot{\mathcal{V}} & = & 3 \mathcal{V} \eta
468 \label{eq:melchionna1}
469 \end{eqnarray}
470
471 $\chi$ and $\eta$ are the ``extra'' degrees of freedom in the extended
472 system. $\chi$ is a thermostat, and it has the same function as it
473 does in the Nos\'e-Hoover NVT integrator. $\eta$ is a barostat which
474 controls changes to the volume of the simulation box. ${\bf R}_0$ is
475 the location of the center of mass for the entire system, and
476 $\mathcal{V}$ is the volume of the simulation box. At any time, the
477 volume can be calculated from the determinant of the matrix which
478 describes the box shape:
479 \begin{equation}
480 \mathcal{V} = \det(\mathsf{H})
481 \end{equation}
482
483 The NPTi integrator requires an instantaneous pressure. This quantity
484 is calculated via the pressure tensor,
485 \begin{equation}
486 \overleftrightarrow{\mathsf{P}}(t) = \frac{1}{\mathcal{V}(t)} \left(
487 \sum_{i=1}^{N} m_i {\bf v}_i(t) \otimes {\bf v}_i(t) \right) +
488 \overleftrightarrow{\mathsf{W}}(t)
489 \end{equation}
490 The kinetic contribution to the pressure tensor utilizes the {\it
491 outer} product of the velocities denoted by the $\otimes$ symbol. The
492 stress tensor is calculated from another outer product of the
493 inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf
494 r}_i$) with the forces between the same two atoms,
495 \begin{equation}
496 \overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf r}_{ij}(t)
497 \otimes {\bf f}_{ij}(t)
498 \end{equation}
499 The instantaneous pressure is then simply obtained from the trace of
500 the Pressure tensor,
501 \begin{equation}
502 P(t) = \frac{1}{3} \mathrm{Tr} \left( \overleftrightarrow{\mathsf{P}}(t)
503 \right)
504 \end{equation}
505
506 In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for
507 relaxation of the pressure to the target value. To set values for
508 $\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one would use the
509 {\tt tauBarostat} and {\tt targetPressure} keywords in the {\tt .bass}
510 file. The units for {\tt tauBarostat} are fs, and the units for the
511 {\tt targetPressure} are atmospheres. Like in the NVT integrator, the
512 integration of the equations of motion is carried out in a
513 velocity-Verlet style 2 part algorithm:
514
515 {\tt moveA:}
516 \begin{eqnarray}
517 T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\
518 P(t) & \leftarrow & \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\}, \left\{{\bf f}(t)\right\} \\
519 {\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf
520 v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
521 \left(\chi(t) + \eta(t) \right) \right) \\
522 {\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf
523 j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
524 \chi(t) \right) \\
525 \mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t *
526 {\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\
527 \chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) +
528 \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1
529 \right) \\
530 \eta(t + \delta t / 2) & \leftarrow & \eta(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B
531 T(t) \tau_B^2} \left( P(t) - P_{\mathrm{target}} \right) \\
532 {\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf
533 v}\left(t + \delta t / 2 \right) + \eta(t + \delta t / 2)\left[ {\bf
534 r}(t + \delta t) - {\bf R}_0 \right] \right\} \\
535 \mathsf{H}(t + \delta t) & \leftarrow & e^{-\delta t \eta(t + \delta t
536 / 2)} \mathsf{H}(t)
537 \end{eqnarray}
538
539 Most of these equations are identical to their counterparts in the NVT
540 integrator, but the propagation of positions to time $t + \delta t$
541 depends on the positions at the same time. {\sc oopse} carries out
542 this step iteratively (with a limit of 5 passes through the iterative
543 loop). Also, the simulation box $\mathsf{H}$ is scaled uniformly for
544 one full time step by an exponential factor that depends on the value
545 of $\eta$ at time $t +
546 \delta t / 2$. Reshaping the box uniformly also scales the volume of
547 the box by
548 \begin{equation}
549 \mathcal{V}(t + \delta t) \leftarrow e^{ - 3 \delta t \eta(t + \delta t /2)}
550 \mathcal{V}(t)
551 \end{equation}
552
553 The {\tt doForces} step for the NPTi integrator is exactly the same as
554 in both the DLM and NVT integrators. Once the forces and torques have
555 been obtained at the new time step, the velocities can be advanced to
556 the same time value.
557
558 {\tt moveB:}
559 \begin{eqnarray}
560 T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\},
561 \left\{{\bf j}(t + \delta t)\right\} \\
562 P(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\},
563 \left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\
564 \chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t /
565 2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta
566 t)}{T_{\mathrm{target}}} - 1 \right) \\
567 \eta(t + \delta t) & \leftarrow & \eta(t + \delta t / 2) +
568 \frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2}
569 \left( P(t + \delta t) - P_{\mathrm{target}}
570 \right) \\
571 {\bf v}\left(t + \delta t \right) & \leftarrow & {\bf
572 v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left(
573 \frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t)
574 (\chi(t + \delta t) + \eta(t + \delta t)) \right) \\
575 {\bf j}\left(t + \delta t \right) & \leftarrow & {\bf
576 j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf
577 \tau}^b(t + \delta t) - {\bf j}(t + \delta t)
578 \chi(t + \delta t) \right)
579 \end{eqnarray}
580
581 Once again, since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$
582 are required to caclculate $T(t + \delta t)$, $P(t + \delta t)$, $\chi(t +
583 \delta t)$, and $\eta(t + \delta t)$, they indirectly depend on their
584 own values at time $t + \delta t$. {\tt moveB} is therefore done in
585 an iterative fashion until $\chi(t + \delta t)$ and $\eta(t + \delta
586 t)$ become self-consistent. The relative tolerance for the
587 self-consistency check defaults to a value of $\mbox{10}^{-6}$, but
588 {\sc oopse} will terminate the iteration after 4 loops even if the
589 consistency check has not been satisfied.
590
591 The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm is
592 known to conserve a Hamiltonian for the extended system that is, to
593 within a constant, identical to the Gibbs free energy,
594 \begin{equation}
595 H_{\mathrm{NPTi}} = V + K + f k_B T_{\mathrm{target}} \left(
596 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
597 \right) + P_{\mathrm{target}} \mathcal{V}(t).
598 \end{equation}
599 Poor choices of $\delta t$, $\tau_T$, or $\tau_B$ can result in
600 non-conservation of $H_{\mathrm{NPTi}}$, so the conserved quantity is
601 maintained in the last column of the {\tt .stat} file to allow checks
602 on the quality of the integration. It is also known that this
603 algorithm samples the equilibrium distribution for the enthalpy
604 (including contributions for the thermostat and barostat),
605 \begin{equation}
606 H_{\mathrm{NPTi}} = V + K + \frac{f k_B T_{\mathrm{target}}}{2} \left(
607 \chi^2 \tau_T^2 + \eta^2 \tau_B^2 \right) + P_{\mathrm{target}}
608 \mathcal{V}(t).
609 \end{equation}
610
611 Bond constraints are applied at the end of both the {\tt moveA} and
612 {\tt moveB} portions of the algorithm. Details on the constraint
613 algorithms are given in section \ref{sec:rattle}.
614
615 \subsubsection{\label{sec:NPTf}Constant-pressure integration with a
616 flexible box (NPTf)}
617
618 There is a relatively simple generalization of the
619 Nos\'e-Hoover-Andersen method to include changes in the simulation box
620 {\it shape} as well as in the volume of the box. This method utilizes
621 the full $3 \times 3$ pressure tensor and introduces a tensor of
622 extended variables ($\overleftrightarrow{\eta}$) to control changes to
623 the box shape. The equations of motion for this method are
624 \begin{eqnarray}
625 \dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right) \\
626 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} +
627 \chi \mathsf{1}) {\bf v} \\
628 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
629 \mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) \\
630 \dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1}
631 \cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
632 V}{\partial \mathsf{A}} \right) - \chi {\bf j} \\
633 \dot{\chi} & = & \frac{1}{\tau_{T}^2} \left(
634 \frac{T}{T_{\mathrm{target}}} - 1 \right) \\
635 \dot{\overleftrightarrow{eta}} & = & \frac{1}{\tau_{B}^2 f k_B
636 T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) \\
637 \dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H}
638 \label{eq:melchionna2}
639 \end{eqnarray}
640
641 Here, $\mathsf{1}$ is the unit matrix and $\overleftrightarrow{\mathsf{P}}$
642 is the pressure tensor. Again, the volume, $\mathcal{V} = \det
643 \mathsf{H}$.
644
645 The propagation of the equations of motion is nearly identical to the
646 NPTi integration:
647
648 {\tt moveA:}
649 \begin{eqnarray}
650 T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\
651 \overleftrightarrow{\mathsf{P}}(t) & \leftarrow & \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\}, \left\{{\bf f}(t)\right\} \\
652 {\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf
653 v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} -
654 \left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot
655 {\bf v}(t) \right) \\
656 {\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf
657 j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
658 \chi(t) \right) \\
659 \mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t *
660 {\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\
661 \chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) +
662 \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1
663 \right) \\
664 \overleftrightarrow{\eta}(t + \delta t / 2) & \leftarrow & \overleftrightarrow{\eta}(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B
665 T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t) - P_{\mathrm{target}}\mathsf{1} \right) \\
666 {\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf
667 v}\left(t + \delta t / 2 \right) + \overleftrightarrow{\eta}(t +
668 \delta t / 2) \cdot \left[ {\bf
669 r}(t + \delta t) - {\bf R}_0 \right] \right\} \\
670 \mathsf{H}(t + \delta t) & \leftarrow & \mathsf{H}(t) \cdot e^{-\delta t
671 \overleftrightarrow{\eta}(t + \delta t / 2)}
672 \end{eqnarray}
673 {\sc oopse} uses a power series expansion truncated at second order
674 for the exponential operation which scales the simulation box.
675
676 The {\tt moveB} portion of the algorithm is largely unchanged from the
677 NPTi integrator:
678
679 {\tt moveB:}
680 \begin{eqnarray}
681 T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\},
682 \left\{{\bf j}(t + \delta t)\right\} \\
683 \overleftrightarrow{\mathsf{P}}(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\},
684 \left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\
685 \chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t /
686 2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta
687 t)}{T_{\mathrm{target}}} - 1 \right) \\
688 \overleftrightarrow{\eta}(t + \delta t) & \leftarrow & \overleftrightarrow{\eta}(t + \delta t / 2) +
689 \frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2}
690 \left( \overleftrightarrow{P}(t + \delta t) - P_{\mathrm{target}}\mathsf{1}
691 \right) \\
692 {\bf v}\left(t + \delta t \right) & \leftarrow & {\bf
693 v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left(
694 \frac{{\bf f}(t + \delta t)}{m} -
695 (\chi(t + \delta t)\mathsf{1} + \overleftrightarrow{\eta}(t + \delta
696 t)) \right) \cdot {\bf v}(t + \delta t) \\
697 {\bf j}\left(t + \delta t \right) & \leftarrow & {\bf
698 j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf
699 \tau}^b(t + \delta t) - {\bf j}(t + \delta t)
700 \chi(t + \delta t) \right)
701 \end{eqnarray}
702
703 The iterative schemes for both {\tt moveA} and {\tt moveB} are
704 identical to those described for the NPTi integrator.
705
706 The NPTf integrator is known to conserve the following Hamiltonian:
707 \begin{equation}
708 H_{\mathrm{NPTf}} = V + K + f k_B T_{\mathrm{target}} \left(
709 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime
710 \right) + P_{\mathrm{target}} \mathcal{V}(t) + \frac{f k_B
711 T_{\mathrm{target}}}{2}
712 \mathrm{Tr}\left[\overleftrightarrow{\eta}(t)\right]^2 \tau_B^2.
713 \end{equation}
714
715 This integrator must be used with care, particularly in liquid
716 simulations. Liquids have very small restoring forces in the
717 off-diagonal directions, and the simulation box can very quickly form
718 elongated and sheared geometries which become smaller than the
719 electrostatic or Lennard-Jones cutoff radii. It finds most use in
720 simulating crystals or liquid crystals which assume non-orthorhombic
721 geometries.
722
723 \subsubsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)}
724
725 There is one additional extended system integrator which is somewhat
726 simpler than the NPTf method described above. In this case, the three
727 axes have independent barostats which each attempt to preserve the
728 target pressure along the box walls perpendicular to that particular
729 axis. The lengths of the box axes are allowed to fluctuate
730 independently, but the angle between the box axes does not change.
731 The equations of motion are identical to those described above, but
732 only the {\it diagonal} elements of $\overleftrightarrow{\eta}$ are
733 computed. The off-diagonal elements are set to zero (even when the
734 pressure tensor has non-zero off-diagonal elements).
735
736 It should be noted that the NPTxyz integrator is {\it not} known to
737 preserve any Hamiltonian of interest to the chemical physics
738 community. The integrator is extremely useful, however, in generating
739 initial conditions for other integration methods. It {\it is} suitable
740 for use with liquid simulations, or in cases where there is
741 orientational anisotropy in the system (i.e. in lipid bilayer
742 simulations).
743
744 \subsection{\label{Sec:zcons}Z-Constraint Method}
745
746 Based on fluctuatin-dissipation theorem,\bigskip\ force
747 auto-correlation method was developed to investigate the dynamics of
748 ions inside the ion channels.\cite{Roux91} Time-dependent friction
749 coefficient can be calculated from the deviation of the instaneous
750 force from its mean force.
751
752 %
753
754 \begin{equation}
755 \xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T
756 \end{equation}
757
758
759 where%
760 \begin{equation}
761 \delta F(z,t)=F(z,t)-\langle F(z,t)\rangle
762 \end{equation}
763
764
765 If the time-dependent friction decay rapidly, static friction coefficient can
766 be approximated by%
767
768 \begin{equation}
769 \xi^{static}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt
770 \end{equation}
771
772
773 Hence, diffusion constant can be estimated by
774 \begin{equation}
775 D(z)=\frac{k_{B}T}{\xi^{static}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty
776 }\langle\delta F(z,t)\delta F(z,0)\rangle dt}%
777 \end{equation}
778
779
780 \bigskip Z-Constraint method, which fixed the z coordinates of the molecules
781 with respect to the center of the mass of the system, was proposed to obtain
782 the forces required in force auto-correlation method.\cite{Marrink94} However,
783 simply resetting the coordinate will move the center of the mass of the whole
784 system. To avoid this problem, a new method was used at {\sc oopse}. Instead of
785 resetting the coordinate, we reset the forces of z-constraint molecules as
786 well as subtract the total constraint forces from the rest of the system after
787 force calculation at each time step.
788 \begin{verbatim}
789 $F_{\alpha i}=0$
790 $V_{\alpha i}=V_{\alpha i}-\frac{\sum\limits_{i}M_{_{\alpha i}}V_{\alpha i}}{\sum\limits_{i}M_{_{\alpha i}}}$
791 $F_{\alpha i}=F_{\alpha i}-\frac{M_{_{\alpha i}}}{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}}\sum\limits_{\beta}F_{\beta}$
792 $V_{\alpha i}=V_{\alpha i}-\frac{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}V_{\alpha i}}{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}}$
793 \end{verbatim}
794
795 At the very beginning of the simulation, the molecules may not be at its
796 constraint position. To move the z-constraint molecule to the specified
797 position, a simple harmonic potential is used%
798
799 \begin{equation}
800 U(t)=\frac{1}{2}k_{Harmonic}(z(t)-z_{cons})^{2}%
801 \end{equation}
802 where $k_{Harmonic}$\bigskip\ is the harmonic force constant, $z(t)$ is
803 current z coordinate of the center of mass of the z-constraint molecule, and
804 $z_{cons}$ is the restraint position. Therefore, the harmonic force operated
805 on the z-constraint molecule at time $t$ can be calculated by%
806 \begin{equation}
807 F_{z_{Harmonic}}(t)=-\frac{\partial U(t)}{\partial z(t)}=-k_{Harmonic}%
808 (z(t)-z_{cons})
809 \end{equation}
810 Worthy of mention, other kinds of potential functions can also be used to
811 drive the z-constraint molecule.