ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/tengDissertation/Methodology.tex
Revision: 2853
Committed: Sun Jun 11 02:23:00 2006 UTC (18 years, 1 month ago) by tim
Content type: application/x-tex
File size: 31417 byte(s)
Log Message:
seperate Langevin chapter

File Contents

# Content
1 \chapter{\label{chapt:methodology}METHODOLOGY}
2
3 \section{\label{methodSection:rigidBodyIntegrators}Integrators for Rigid Body Motion in Molecular Dynamics}
4
5 In order to mimic the experiments, which are usually performed under
6 constant temperature and/or pressure, extended Hamiltonian system
7 methods have been developed to generate statistical ensembles, such
8 as canonical ensemble and isobaric-isothermal ensemble \textit{etc}.
9 In addition to the standard ensemble, specific ensembles have been
10 developed to account for the anisotropy between the lateral and
11 normal directions of membranes. The $NPAT$ ensemble, in which the
12 normal pressure and the lateral surface area of the membrane are
13 kept constant, and the $NP\gamma T$ ensemble, in which the normal
14 pressure and the lateral surface tension are kept constant were
15 proposed to address this issue.
16
17 Integration schemes for rotational motion of the rigid molecules in
18 microcanonical ensemble have been extensively studied in the last
19 two decades. Matubayasi developed a time-reversible integrator for
20 rigid bodies in quaternion representation. Although it is not
21 symplectic, this integrator still demonstrates a better long-time
22 energy conservation than traditional methods because of the
23 time-reversible nature. Extending Trotter-Suzuki to general system
24 with a flat phase space, Miller and his colleagues devised an novel
25 symplectic, time-reversible and volume-preserving integrator in
26 quaternion representation, which was shown to be superior to the
27 Matubayasi's time-reversible integrator. However, all of the
28 integrators in quaternion representation suffer from the
29 computational penalty of constructing a rotation matrix from
30 quaternions to evolve coordinates and velocities at every time step.
31 An alternative integration scheme utilizing rotation matrix directly
32 proposed by Dullweber, Leimkuhler and McLachlan (DLM) also preserved
33 the same structural properties of the Hamiltonian flow. In this
34 section, the integration scheme of DLM method will be reviewed and
35 extended to other ensembles.
36
37 \subsection{\label{methodSection:DLM}Integrating the Equations of Motion: the
38 DLM method}
39
40 The DLM method uses a Trotter factorization of the orientational
41 propagator. This has three effects:
42 \begin{enumerate}
43 \item the integrator is area-preserving in phase space (i.e. it is
44 {\it symplectic}),
45 \item the integrator is time-{\it reversible}, making it suitable for Hybrid
46 Monte Carlo applications, and
47 \item the error for a single time step is of order $\mathcal{O}\left(h^4\right)$
48 for timesteps of length $h$.
49 \end{enumerate}
50
51 The integration of the equations of motion is carried out in a
52 velocity-Verlet style 2-part algorithm, where $h= \delta t$:
53
54 {\tt moveA:}
55 \begin{align*}
56 {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
57 + \frac{h}{2} \left( {\bf f}(t) / m \right), \\
58 %
59 {\bf r}(t + h) &\leftarrow {\bf r}(t)
60 + h {\bf v}\left(t + h / 2 \right), \\
61 %
62 {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
63 + \frac{h}{2} {\bf \tau}^b(t), \\
64 %
65 \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left( h {\bf j}
66 (t + h / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} \right).
67 \end{align*}
68
69 In this context, the $\mathrm{rotate}$ function is the reversible
70 product of the three body-fixed rotations,
71 \begin{equation}
72 \mathrm{rotate}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot
73 \mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y
74 / 2) \cdot \mathsf{G}_x(a_x /2),
75 \end{equation}
76 where each rotational propagator, $\mathsf{G}_\alpha(\theta)$,
77 rotates both the rotation matrix ($\mathsf{A}$) and the body-fixed
78 angular momentum (${\bf j}$) by an angle $\theta$ around body-fixed
79 axis $\alpha$,
80 \begin{equation}
81 \mathsf{G}_\alpha( \theta ) = \left\{
82 \begin{array}{lcl}
83 \mathsf{A}(t) & \leftarrow & \mathsf{A}(0) \cdot \mathsf{R}_\alpha(\theta)^T, \\
84 {\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf
85 j}(0).
86 \end{array}
87 \right.
88 \end{equation}
89 $\mathsf{R}_\alpha$ is a quadratic approximation to the single-axis
90 rotation matrix. For example, in the small-angle limit, the
91 rotation matrix around the body-fixed x-axis can be approximated as
92 \begin{equation}
93 \mathsf{R}_x(\theta) \approx \left(
94 \begin{array}{ccc}
95 1 & 0 & 0 \\
96 0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+
97 \theta^2 / 4} \\
98 0 & \frac{\theta}{1+ \theta^2 / 4} & \frac{1-\theta^2 / 4}{1 +
99 \theta^2 / 4}
100 \end{array}
101 \right).
102 \end{equation}
103 All other rotations follow in a straightforward manner.
104
105 After the first part of the propagation, the forces and body-fixed
106 torques are calculated at the new positions and orientations
107
108 {\tt doForces:}
109 \begin{align*}
110 {\bf f}(t + h) &\leftarrow
111 - \left(\frac{\partial V}{\partial {\bf r}}\right)_{{\bf r}(t + h)}, \\
112 %
113 {\bf \tau}^{s}(t + h) &\leftarrow {\bf u}(t + h)
114 \times \frac{\partial V}{\partial {\bf u}}, \\
115 %
116 {\bf \tau}^{b}(t + h) &\leftarrow \mathsf{A}(t + h)
117 \cdot {\bf \tau}^s(t + h).
118 \end{align*}
119
120 {\sc oopse} automatically updates ${\bf u}$ when the rotation matrix
121 $\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and
122 torques have been obtained at the new time step, the velocities can
123 be advanced to the same time value.
124
125 {\tt moveB:}
126 \begin{align*}
127 {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t + h / 2
128 \right)
129 + \frac{h}{2} \left( {\bf f}(t + h) / m \right), \\
130 %
131 {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t + h / 2
132 \right)
133 + \frac{h}{2} {\bf \tau}^b(t + h) .
134 \end{align*}
135
136 The matrix rotations used in the DLM method end up being more costly
137 computationally than the simpler arithmetic quaternion propagation.
138 With the same time step, a 1000-molecule water simulation shows an
139 average 7\% increase in computation time using the DLM method in
140 place of quaternions. This cost is more than justified when
141 comparing the energy conservation of the two methods as illustrated
142 in Fig.~\ref{methodFig:timestep}.
143
144 \begin{figure}
145 \centering
146 \includegraphics[width=\linewidth]{timeStep.eps}
147 \caption[Energy conservation for quaternion versus DLM
148 dynamics]{Energy conservation using quaternion based integration
149 versus the method proposed by Dullweber \emph{et al.} with
150 increasing time step. For each time step, the dotted line is total
151 energy using the DLM integrator, and the solid line comes from the
152 quaternion integrator. The larger time step plots are shifted up
153 from the true energy baseline for clarity.}
154 \label{methodFig:timestep}
155 \end{figure}
156
157 In Fig.~\ref{methodFig:timestep}, the resulting energy drift at
158 various time steps for both the DLM and quaternion integration
159 schemes is compared. All of the 1000 molecule water simulations
160 started with the same configuration, and the only difference was the
161 method for handling rotational motion. At time steps of 0.1 and 0.5
162 fs, both methods for propagating molecule rotation conserve energy
163 fairly well, with the quaternion method showing a slight energy
164 drift over time in the 0.5 fs time step simulation. At time steps of
165 1 and 2 fs, the energy conservation benefits of the DLM method are
166 clearly demonstrated. Thus, while maintaining the same degree of
167 energy conservation, one can take considerably longer time steps,
168 leading to an overall reduction in computation time.
169
170 \subsection{\label{methodSection:NVT}Nos\'{e}-Hoover Thermostatting}
171
172 The Nos\'e-Hoover equations of motion are given by\cite{Hoover1985}
173 \begin{eqnarray}
174 \dot{{\bf r}} & = & {\bf v}, \\
175 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} ,\\
176 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
177 \mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right), \\
178 \dot{{\bf j}} & = & {\bf j} \times \left(
179 \overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j} \right) - \mbox{
180 rot}\left(\mathsf{A}^{T} \cdot \frac{\partial V}{\partial
181 \mathsf{A}} \right) - \chi {\bf j}. \label{eq:nosehoovereom}
182 \end{eqnarray}
183
184 $\chi$ is an ``extra'' variable included in the extended system, and
185 it is propagated using the first order equation of motion
186 \begin{equation}
187 \dot{\chi} = \frac{1}{\tau_{T}^2} \left(
188 \frac{T}{T_{\mathrm{target}}} - 1 \right). \label{eq:nosehooverext}
189 \end{equation}
190
191 The instantaneous temperature $T$ is proportional to the total
192 kinetic energy (both translational and orientational) and is given
193 by
194 \begin{equation}
195 T = \frac{2 K}{f k_B}
196 \end{equation}
197 Here, $f$ is the total number of degrees of freedom in the system,
198 \begin{equation}
199 f = 3 N + 3 N_{\mathrm{orient}} - N_{\mathrm{constraints}},
200 \end{equation}
201 and $K$ is the total kinetic energy,
202 \begin{equation}
203 K = \sum_{i=1}^{N} \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i +
204 \sum_{i=1}^{N_{\mathrm{orient}}} \frac{1}{2} {\bf j}_i^T \cdot
205 \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot {\bf j}_i.
206 \end{equation}
207
208 In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for
209 relaxation of the temperature to the target value. To set values
210 for $\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use
211 the {\tt tauThermostat} and {\tt targetTemperature} keywords in the
212 {\tt .bass} file. The units for {\tt tauThermostat} are fs, and the
213 units for the {\tt targetTemperature} are degrees K. The
214 integration of the equations of motion is carried out in a
215 velocity-Verlet style 2 part algorithm:
216
217 {\tt moveA:}
218 \begin{align*}
219 T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\
220 %
221 {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
222 + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
223 \chi(t)\right), \\
224 %
225 {\bf r}(t + h) &\leftarrow {\bf r}(t)
226 + h {\bf v}\left(t + h / 2 \right) ,\\
227 %
228 {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
229 + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
230 \chi(t) \right) ,\\
231 %
232 \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}
233 \left(h * {\bf j}(t + h / 2)
234 \overleftrightarrow{\mathsf{I}}^{-1} \right) ,\\
235 %
236 \chi\left(t + h / 2 \right) &\leftarrow \chi(t)
237 + \frac{h}{2 \tau_T^2} \left( \frac{T(t)}
238 {T_{\mathrm{target}}} - 1 \right) .
239 \end{align*}
240
241 Here $\mathrm{rotate}(h * {\bf j}
242 \overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic
243 Trotter factorization of the three rotation operations that was
244 discussed in the section on the DLM integrator. Note that this
245 operation modifies both the rotation matrix $\mathsf{A}$ and the
246 angular momentum ${\bf j}$. {\tt moveA} propagates velocities by a
247 half time step, and positional degrees of freedom by a full time
248 step. The new positions (and orientations) are then used to
249 calculate a new set of forces and torques in exactly the same way
250 they are calculated in the {\tt doForces} portion of the DLM
251 integrator.
252
253 Once the forces and torques have been obtained at the new time step,
254 the temperature, velocities, and the extended system variable can be
255 advanced to the same time value.
256
257 {\tt moveB:}
258 \begin{align*}
259 T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\},
260 \left\{{\bf j}(t + h)\right\}, \\
261 %
262 \chi\left(t + h \right) &\leftarrow \chi\left(t + h /
263 2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+h)}
264 {T_{\mathrm{target}}} - 1 \right), \\
265 %
266 {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
267 + h / 2 \right) + \frac{h}{2} \left(
268 \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h)
269 \chi(t h)\right) ,\\
270 %
271 {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t
272 + h / 2 \right) + \frac{h}{2}
273 \left( {\bf \tau}^b(t + h) - {\bf j}(t + h)
274 \chi(t + h) \right) .
275 \end{align*}
276
277 Since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required to
278 caclculate $T(t + h)$ as well as $\chi(t + h)$, they indirectly
279 depend on their own values at time $t + h$. {\tt moveB} is
280 therefore done in an iterative fashion until $\chi(t + h)$ becomes
281 self-consistent. The relative tolerance for the self-consistency
282 check defaults to a value of $\mbox{10}^{-6}$, but {\sc oopse} will
283 terminate the iteration after 4 loops even if the consistency check
284 has not been satisfied.
285
286 The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for
287 the extended system that is, to within a constant, identical to the
288 Helmholtz free energy,\cite{Melchionna1993}
289 \begin{equation}
290 H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left(
291 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime)
292 dt^\prime \right).
293 \end{equation}
294 Poor choices of $h$ or $\tau_T$ can result in non-conservation of
295 $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the
296 last column of the {\tt .stat} file to allow checks on the quality
297 of the integration.
298
299 \subsection{\label{methodSection:NPTi}Constant-pressure integration with
300 isotropic box deformations (NPTi)}
301
302 To carry out isobaric-isothermal ensemble calculations {\sc oopse}
303 implements the Melchionna modifications to the
304 Nos\'e-Hoover-Andersen equations of motion,\cite{Melchionna1993}
305
306 \begin{eqnarray}
307 \dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right), \\
308 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v}, \\
309 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
310 \mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right),\\
311 \dot{{\bf j}} & = & {\bf j} \times \left(
312 \overleftrightarrow{I}^{-1} \cdot {\bf j} \right) - \mbox{
313 rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
314 V}{\partial \mathsf{A}} \right) - \chi {\bf j}, \\
315 \dot{\chi} & = & \frac{1}{\tau_{T}^2} \left(
316 \frac{T}{T_{\mathrm{target}}} - 1 \right) ,\\
317 \dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V
318 \left( P -
319 P_{\mathrm{target}} \right), \\
320 \dot{\mathcal{V}} & = & 3 \mathcal{V} \eta . \label{eq:melchionna1}
321 \end{eqnarray}
322
323 $\chi$ and $\eta$ are the ``extra'' degrees of freedom in the
324 extended system. $\chi$ is a thermostat, and it has the same
325 function as it does in the Nos\'e-Hoover NVT integrator. $\eta$ is
326 a barostat which controls changes to the volume of the simulation
327 box. ${\bf R}_0$ is the location of the center of mass for the
328 entire system, and $\mathcal{V}$ is the volume of the simulation
329 box. At any time, the volume can be calculated from the determinant
330 of the matrix which describes the box shape:
331 \begin{equation}
332 \mathcal{V} = \det(\mathsf{H}).
333 \end{equation}
334
335 The NPTi integrator requires an instantaneous pressure. This
336 quantity is calculated via the pressure tensor,
337 \begin{equation}
338 \overleftrightarrow{\mathsf{P}}(t) = \frac{1}{\mathcal{V}(t)} \left(
339 \sum_{i=1}^{N} m_i {\bf v}_i(t) \otimes {\bf v}_i(t) \right) +
340 \overleftrightarrow{\mathsf{W}}(t).
341 \end{equation}
342 The kinetic contribution to the pressure tensor utilizes the {\it
343 outer} product of the velocities denoted by the $\otimes$ symbol.
344 The stress tensor is calculated from another outer product of the
345 inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf
346 r}_i$) with the forces between the same two atoms,
347 \begin{equation}
348 \overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf
349 r}_{ij}(t) \otimes {\bf f}_{ij}(t).
350 \end{equation}
351 The instantaneous pressure is then simply obtained from the trace of
352 the Pressure tensor,
353 \begin{equation}
354 P(t) = \frac{1}{3} \mathrm{Tr} \left(
355 \overleftrightarrow{\mathsf{P}}(t). \right)
356 \end{equation}
357
358 In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for
359 relaxation of the pressure to the target value. Like in the NVT
360 integrator, the integration of the equations of motion is carried
361 out in a velocity-Verlet style 2 part algorithm:
362
363 {\tt moveA:}
364 \begin{align*}
365 T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\
366 %
367 P(t) &\leftarrow \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\} ,\\
368 %
369 {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
370 + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t)
371 \left(\chi(t) + \eta(t) \right) \right), \\
372 %
373 {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
374 + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
375 \chi(t) \right), \\
376 %
377 \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left(h *
378 {\bf j}(t + h / 2) \overleftrightarrow{\mathsf{I}}^{-1}
379 \right) ,\\
380 %
381 \chi\left(t + h / 2 \right) &\leftarrow \chi(t) +
382 \frac{h}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1
383 \right) ,\\
384 %
385 \eta(t + h / 2) &\leftarrow \eta(t) + \frac{h
386 \mathcal{V}(t)}{2 N k_B T(t) \tau_B^2} \left( P(t)
387 - P_{\mathrm{target}} \right), \\
388 %
389 {\bf r}(t + h) &\leftarrow {\bf r}(t) + h
390 \left\{ {\bf v}\left(t + h / 2 \right)
391 + \eta(t + h / 2)\left[ {\bf r}(t + h)
392 - {\bf R}_0 \right] \right\} ,\\
393 %
394 \mathsf{H}(t + h) &\leftarrow e^{-h \eta(t + h / 2)}
395 \mathsf{H}(t).
396 \end{align*}
397
398 Most of these equations are identical to their counterparts in the
399 NVT integrator, but the propagation of positions to time $t + h$
400 depends on the positions at the same time. {\sc oopse} carries out
401 this step iteratively (with a limit of 5 passes through the
402 iterative loop). Also, the simulation box $\mathsf{H}$ is scaled
403 uniformly for one full time step by an exponential factor that
404 depends on the value of $\eta$ at time $t + h / 2$. Reshaping the
405 box uniformly also scales the volume of the box by
406 \begin{equation}
407 \mathcal{V}(t + h) \leftarrow e^{ - 3 h \eta(t + h /2)}.
408 \mathcal{V}(t)
409 \end{equation}
410
411 The {\tt doForces} step for the NPTi integrator is exactly the same
412 as in both the DLM and NVT integrators. Once the forces and torques
413 have been obtained at the new time step, the velocities can be
414 advanced to the same time value.
415
416 {\tt moveB:}
417 \begin{align*}
418 T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\},
419 \left\{{\bf j}(t + h)\right\} ,\\
420 %
421 P(t + h) &\leftarrow \left\{{\bf r}(t + h)\right\},
422 \left\{{\bf v}(t + h)\right\}, \\
423 %
424 \chi\left(t + h \right) &\leftarrow \chi\left(t + h /
425 2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+h)}
426 {T_{\mathrm{target}}} - 1 \right), \\
427 %
428 \eta(t + h) &\leftarrow \eta(t + h / 2) +
429 \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h)
430 \tau_B^2} \left( P(t + h) - P_{\mathrm{target}} \right), \\
431 %
432 {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
433 + h / 2 \right) + \frac{h}{2} \left(
434 \frac{{\bf f}(t + h)}{m} - {\bf v}(t + h)
435 (\chi(t + h) + \eta(t + h)) \right) ,\\
436 %
437 {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t
438 + h / 2 \right) + \frac{h}{2} \left( {\bf
439 \tau}^b(t + h) - {\bf j}(t + h)
440 \chi(t + h) \right) .
441 \end{align*}
442
443 Once again, since ${\bf v}(t + h)$ and ${\bf j}(t + h)$ are required
444 to caclculate $T(t + h)$, $P(t + h)$, $\chi(t + h)$, and $\eta(t +
445 h)$, they indirectly depend on their own values at time $t + h$.
446 {\tt moveB} is therefore done in an iterative fashion until $\chi(t
447 + h)$ and $\eta(t + h)$ become self-consistent. The relative
448 tolerance for the self-consistency check defaults to a value of
449 $\mbox{10}^{-6}$, but {\sc oopse} will terminate the iteration after
450 4 loops even if the consistency check has not been satisfied.
451
452 The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm
453 is known to conserve a Hamiltonian for the extended system that is,
454 to within a constant, identical to the Gibbs free energy,
455 \begin{equation}
456 H_{\mathrm{NPTi}} = V + K + f k_B T_{\mathrm{target}} \left(
457 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime)
458 dt^\prime \right) + P_{\mathrm{target}} \mathcal{V}(t).
459 \end{equation}
460 Poor choices of $\delta t$, $\tau_T$, or $\tau_B$ can result in
461 non-conservation of $H_{\mathrm{NPTi}}$, so the conserved quantity
462 is maintained in the last column of the {\tt .stat} file to allow
463 checks on the quality of the integration. It is also known that
464 this algorithm samples the equilibrium distribution for the enthalpy
465 (including contributions for the thermostat and barostat),
466 \begin{equation}
467 H_{\mathrm{NPTi}} = V + K + \frac{f k_B T_{\mathrm{target}}}{2}
468 \left( \chi^2 \tau_T^2 + \eta^2 \tau_B^2 \right) +
469 P_{\mathrm{target}} \mathcal{V}(t).
470 \end{equation}
471
472 \subsection{\label{methodSection:NPTf}Constant-pressure integration with a
473 flexible box (NPTf)}
474
475 There is a relatively simple generalization of the
476 Nos\'e-Hoover-Andersen method to include changes in the simulation
477 box {\it shape} as well as in the volume of the box. This method
478 utilizes the full $3 \times 3$ pressure tensor and introduces a
479 tensor of extended variables ($\overleftrightarrow{\eta}$) to
480 control changes to the box shape. The equations of motion for this
481 method are
482 \begin{eqnarray}
483 \dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right), \\
484 \dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} +
485 \chi \cdot \mathsf{1}) {\bf v}, \\
486 \dot{\mathsf{A}} & = & \mathsf{A} \cdot
487 \mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) ,\\
488 \dot{{\bf j}} & = & {\bf j} \times \left(
489 \overleftrightarrow{I}^{-1} \cdot {\bf j} \right) - \mbox{
490 rot}\left(\mathsf{A}^{T} \cdot \frac{\partial
491 V}{\partial \mathsf{A}} \right) - \chi {\bf j} ,\\
492 \dot{\chi} & = & \frac{1}{\tau_{T}^2} \left(
493 \frac{T}{T_{\mathrm{target}}} - 1 \right) ,\\
494 \dot{\overleftrightarrow{\eta}} & = & \frac{1}{\tau_{B}^2 f k_B
495 T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) ,\\
496 \dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H} .
497 \label{eq:melchionna2}
498 \end{eqnarray}
499
500 Here, $\mathsf{1}$ is the unit matrix and
501 $\overleftrightarrow{\mathsf{P}}$ is the pressure tensor. Again,
502 the volume, $\mathcal{V} = \det \mathsf{H}$.
503
504 The propagation of the equations of motion is nearly identical to
505 the NPTi integration:
506
507 {\tt moveA:}
508 \begin{align*}
509 T(t) &\leftarrow \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} ,\\
510 %
511 \overleftrightarrow{\mathsf{P}}(t) &\leftarrow \left\{{\bf
512 r}(t)\right\},
513 \left\{{\bf v}(t)\right\} ,\\
514 %
515 {\bf v}\left(t + h / 2\right) &\leftarrow {\bf v}(t)
516 + \frac{h}{2} \left( \frac{{\bf f}(t)}{m} -
517 \left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot
518 {\bf v}(t) \right), \\
519 %
520 {\bf j}\left(t + h / 2 \right) &\leftarrow {\bf j}(t)
521 + \frac{h}{2} \left( {\bf \tau}^b(t) - {\bf j}(t)
522 \chi(t) \right), \\
523 %
524 \mathsf{A}(t + h) &\leftarrow \mathrm{rotate}\left(h *
525 {\bf j}(t + h / 2) \overleftrightarrow{\mathsf{I}}^{-1}
526 \right), \\
527 %
528 \chi\left(t + h / 2 \right) &\leftarrow \chi(t) +
529 \frac{h}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}}
530 - 1 \right), \\
531 %
532 \overleftrightarrow{\eta}(t + h / 2) &\leftarrow
533 \overleftrightarrow{\eta}(t) + \frac{h \mathcal{V}(t)}{2 N k_B
534 T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t)
535 - P_{\mathrm{target}}\mathsf{1} \right), \\
536 %
537 {\bf r}(t + h) &\leftarrow {\bf r}(t) + h \left\{ {\bf v}
538 \left(t + h / 2 \right) + \overleftrightarrow{\eta}(t +
539 h / 2) \cdot \left[ {\bf r}(t + h)
540 - {\bf R}_0 \right] \right\}, \\
541 %
542 \mathsf{H}(t + h) &\leftarrow \mathsf{H}(t) \cdot e^{-h
543 \overleftrightarrow{\eta}(t + h / 2)} .
544 \end{align*}
545 {\sc oopse} uses a power series expansion truncated at second order
546 for the exponential operation which scales the simulation box.
547
548 The {\tt moveB} portion of the algorithm is largely unchanged from
549 the NPTi integrator:
550
551 {\tt moveB:}
552 \begin{align*}
553 T(t + h) &\leftarrow \left\{{\bf v}(t + h)\right\},
554 \left\{{\bf j}(t + h)\right\}, \\
555 %
556 \overleftrightarrow{\mathsf{P}}(t + h) &\leftarrow \left\{{\bf r}
557 (t + h)\right\}, \left\{{\bf v}(t
558 + h)\right\}, \left\{{\bf f}(t + h)\right\} ,\\
559 %
560 \chi\left(t + h \right) &\leftarrow \chi\left(t + h /
561 2 \right) + \frac{h}{2 \tau_T^2} \left( \frac{T(t+
562 h)}{T_{\mathrm{target}}} - 1 \right), \\
563 %
564 \overleftrightarrow{\eta}(t + h) &\leftarrow
565 \overleftrightarrow{\eta}(t + h / 2) +
566 \frac{h \mathcal{V}(t + h)}{2 N k_B T(t + h)
567 \tau_B^2} \left( \overleftrightarrow{P}(t + h)
568 - P_{\mathrm{target}}\mathsf{1} \right) ,\\
569 %
570 {\bf v}\left(t + h \right) &\leftarrow {\bf v}\left(t
571 + h / 2 \right) + \frac{h}{2} \left(
572 \frac{{\bf f}(t + h)}{m} -
573 (\chi(t + h)\mathsf{1} + \overleftrightarrow{\eta}(t
574 + h)) \right) \cdot {\bf v}(t + h), \\
575 %
576 {\bf j}\left(t + h \right) &\leftarrow {\bf j}\left(t
577 + h / 2 \right) + \frac{h}{2} \left( {\bf \tau}^b(t
578 + h) - {\bf j}(t + h) \chi(t + h) \right) .
579 \end{align*}
580
581 The iterative schemes for both {\tt moveA} and {\tt moveB} are
582 identical to those described for the NPTi integrator.
583
584 The NPTf integrator is known to conserve the following Hamiltonian:
585 \begin{equation}
586 H_{\mathrm{NPTf}} = V + K + f k_B T_{\mathrm{target}} \left(
587 \frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime)
588 dt^\prime \right) + P_{\mathrm{target}} \mathcal{V}(t) + \frac{f k_B
589 T_{\mathrm{target}}}{2}
590 \mathrm{Tr}\left[\overleftrightarrow{\eta}(t)\right]^2 \tau_B^2.
591 \end{equation}
592
593 This integrator must be used with care, particularly in liquid
594 simulations. Liquids have very small restoring forces in the
595 off-diagonal directions, and the simulation box can very quickly
596 form elongated and sheared geometries which become smaller than the
597 electrostatic or Lennard-Jones cutoff radii. The NPTf integrator
598 finds most use in simulating crystals or liquid crystals which
599 assume non-orthorhombic geometries.
600
601 \subsection{\label{methodSection:otherSpecialEnsembles}Other Special Ensembles}
602
603 \subsubsection{\label{methodSection:NPAT}\textbf{NPAT Ensemble}}
604
605 A comprehensive understanding of structure¨Cfunction relations of
606 biological membrane system ultimately relies on structure and
607 dynamics of lipid bilayer, which are strongly affected by the
608 interfacial interaction between lipid molecules and surrounding
609 media. One quantity to describe the interfacial interaction is so
610 called the average surface area per lipid. Constat area and constant
611 lateral pressure simulation can be achieved by extending the
612 standard NPT ensemble with a different pressure control strategy
613
614 \begin{equation}
615 \dot {\overleftrightarrow{\eta}} _{\alpha \beta}=\left\{\begin{array}{ll}
616 \frac{{V(P_{\alpha \beta } - P_{{\rm{target}}} )}}{{\tau_{\rm{B}}^{\rm{2}} fk_B T_{{\rm{target}}} }}
617 & \mbox{if $ \alpha = \beta = z$}\\
618 0 & \mbox{otherwise}\\
619 \end{array}
620 \right.
621 \end{equation}
622
623 Note that the iterative schemes for NPAT are identical to those
624 described for the NPTi integrator.
625
626 \subsubsection{\label{methodSection:NPrT}\textbf{NP$\gamma$T Ensemble}}
627
628 Theoretically, the surface tension $\gamma$ of a stress free
629 membrane system should be zero since its surface free energy $G$ is
630 minimum with respect to surface area $A$
631 \[
632 \gamma = \frac{{\partial G}}{{\partial A}}.
633 \]
634 However, a surface tension of zero is not appropriate for relatively
635 small patches of membrane. In order to eliminate the edge effect of
636 the membrane simulation, a special ensemble, NP$\gamma$T, is
637 proposed to maintain the lateral surface tension and normal
638 pressure. The equation of motion for cell size control tensor,
639 $\eta$, in $NP\gamma T$ is
640 \begin{equation}
641 \dot {\overleftrightarrow{\eta}} _{\alpha \beta}=\left\{\begin{array}{ll}
642 - A_{xy} (\gamma _\alpha - \gamma _{{\rm{target}}} ) & \mbox{$\alpha = \beta = x$ or $\alpha = \beta = y$}\\
643 \frac{{V(P_{\alpha \beta } - P_{{\rm{target}}} )}}{{\tau _{\rm{B}}^{\rm{2}} fk_B T_{{\rm{target}}}}} & \mbox{$\alpha = \beta = z$} \\
644 0 & \mbox{$\alpha \ne \beta$} \\
645 \end{array}
646 \right.
647 \end{equation}
648 where $ \gamma _{{\rm{target}}}$ is the external surface tension and
649 the instantaneous surface tensor $\gamma _\alpha$ is given by
650 \begin{equation}
651 \gamma _\alpha = - h_z( \overleftrightarrow{P} _{\alpha \alpha }
652 - P_{{\rm{target}}} )
653 \label{methodEquation:instantaneousSurfaceTensor}
654 \end{equation}
655
656 There is one additional extended system integrator (NPTxyz), in
657 which each attempt to preserve the target pressure along the box
658 walls perpendicular to that particular axis. The lengths of the box
659 axes are allowed to fluctuate independently, but the angle between
660 the box axes does not change. It should be noted that the NPTxyz
661 integrator is a special case of $NP\gamma T$ if the surface tension
662 $\gamma$ is set to zero.
663
664 \section{\label{methodSection:zcons}Z-Constraint Method}
665
666 Based on the fluctuation-dissipation theorem, a force
667 auto-correlation method was developed by Roux and Karplus to
668 investigate the dynamics of ions inside ion channels\cite{Roux1991}.
669 The time-dependent friction coefficient can be calculated from the
670 deviation of the instantaneous force from its mean force.
671 \begin{equation}
672 \xi(z,t)=\langle\delta F(z,t)\delta F(z,0)\rangle/k_{B}T,
673 \end{equation}
674 where%
675 \begin{equation}
676 \delta F(z,t)=F(z,t)-\langle F(z,t)\rangle.
677 \end{equation}
678
679 If the time-dependent friction decays rapidly, the static friction
680 coefficient can be approximated by
681 \begin{equation}
682 \xi_{\text{static}}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta
683 F(z,0)\rangle dt.
684 \end{equation}
685 Allowing diffusion constant to then be calculated through the
686 Einstein relation:\cite{Marrink1994}
687 \begin{equation}
688 D(z)=\frac{k_{B}T}{\xi_{\text{static}}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty
689 }\langle\delta F(z,t)\delta F(z,0)\rangle dt}.%
690 \end{equation}
691
692 The Z-Constraint method, which fixes the z coordinates of the
693 molecules with respect to the center of the mass of the system, has
694 been a method suggested to obtain the forces required for the force
695 auto-correlation calculation.\cite{Marrink1994} However, simply
696 resetting the coordinate will move the center of the mass of the
697 whole system. To avoid this problem, we reset the forces of
698 z-constrained molecules as well as subtract the total constraint
699 forces from the rest of the system after the force calculation at
700 each time step instead of resetting the coordinate.
701
702 After the force calculation, define $G_\alpha$ as
703 \begin{equation}
704 G_{\alpha} = \sum_i F_{\alpha i}, \label{oopseEq:zc1}
705 \end{equation}
706 where $F_{\alpha i}$ is the force in the z direction of atom $i$ in
707 z-constrained molecule $\alpha$. The forces of the z constrained
708 molecule are then set to:
709 \begin{equation}
710 F_{\alpha i} = F_{\alpha i} -
711 \frac{m_{\alpha i} G_{\alpha}}{\sum_i m_{\alpha i}}.
712 \end{equation}
713 Here, $m_{\alpha i}$ is the mass of atom $i$ in the z-constrained
714 molecule. Having rescaled the forces, the velocities must also be
715 rescaled to subtract out any center of mass velocity in the z
716 direction.
717 \begin{equation}
718 v_{\alpha i} = v_{\alpha i} -
719 \frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}},
720 \end{equation}
721 where $v_{\alpha i}$ is the velocity of atom $i$ in the z direction.
722 Lastly, all of the accumulated z constrained forces must be
723 subtracted from the system to keep the system center of mass from
724 drifting.
725 \begin{equation}
726 F_{\beta i} = F_{\beta i} - \frac{m_{\beta i} \sum_{\alpha}
727 G_{\alpha}}
728 {\sum_{\beta}\sum_i m_{\beta i}},
729 \end{equation}
730 where $\beta$ are all of the unconstrained molecules in the system.
731 Similarly, the velocities of the unconstrained molecules must also
732 be scaled.
733 \begin{equation}
734 v_{\beta i} = v_{\beta i} + \sum_{\alpha}
735 \frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}}.
736 \end{equation}
737
738 At the very beginning of the simulation, the molecules may not be at
739 their constrained positions. To move a z-constrained molecule to its
740 specified position, a simple harmonic potential is used
741 \begin{equation}
742 U(t)=\frac{1}{2}k_{\text{Harmonic}}(z(t)-z_{\text{cons}})^{2},%
743 \end{equation}
744 where $k_{\text{Harmonic}}$ is the harmonic force constant, $z(t)$
745 is the current $z$ coordinate of the center of mass of the
746 constrained molecule, and $z_{\text{cons}}$ is the constrained
747 position. The harmonic force operating on the z-constrained molecule
748 at time $t$ can be calculated by
749 \begin{equation}
750 F_{z_{\text{Harmonic}}}(t)=-\frac{\partial U(t)}{\partial z(t)}=
751 -k_{\text{Harmonic}}(z(t)-z_{\text{cons}}).
752 \end{equation}