| 867 |
|
|
| 868 |
|
\section{\label{oopseSec:mechanics}Mechanics} |
| 869 |
|
|
| 870 |
– |
\subsection{\label{oopseSec:integrate}Integrating the Equations of Motion: the Symplectic Step Integrator} |
| 870 |
|
|
| 871 |
< |
Integration of the equations of motion was carried out using the |
| 872 |
< |
symplectic splitting method proposed by Dullweber \emph{et |
| 873 |
< |
al.}.\cite{Dullweber1997} The reason for the selection of this |
| 874 |
< |
integrator, is the poor energy conservation of rigid body systems |
| 875 |
< |
using quaternion dynamics. While quaternions work well for |
| 876 |
< |
orientational motion in alternate ensembles, the microcanonical |
| 877 |
< |
ensemble has a constant energy requirement that is quite sensitive to |
| 878 |
< |
errors in the equations of motion. The original implementation of {\sc |
| 879 |
< |
oopse} utilized quaternions for rotational motion propagation; |
| 880 |
< |
however, a detailed investigation showed that they resulted in a |
| 881 |
< |
steady drift in the total energy, something that has been observed by |
| 882 |
< |
others.\cite{Laird97} |
| 871 |
> |
\section{\label{sec:mechanics}Mechanics} |
| 872 |
> |
|
| 873 |
> |
\subsection{\label{oopseSec:integrate}Integrating the Equations of Motion: the |
| 874 |
> |
DLM method} |
| 875 |
> |
|
| 876 |
> |
The default method for integrating the equations of motion in {\sc |
| 877 |
> |
oopse} is a velocity-Verlet version of the symplectic splitting method |
| 878 |
> |
proposed by Dullweber, Leimkuhler and McLachlan |
| 879 |
> |
(DLM).\cite{Dullweber1997} When there are no directional atoms or |
| 880 |
> |
rigid bodies present in the simulation, this integrator becomes the |
| 881 |
> |
standard velocity-Verlet integrator which is known to sample the |
| 882 |
> |
microcanonical (NVE) ensemble.\cite{} |
| 883 |
> |
|
| 884 |
> |
Previous integration methods for orientational motion have problems |
| 885 |
> |
that are avoided in the DLM method. Direct propagation of the Euler |
| 886 |
> |
angles has a known $1/\sin\theta$ divergence in the equations of |
| 887 |
> |
motion for $\phi$ and $\psi$,\cite{allen87:csl} leading to |
| 888 |
> |
numerical instabilities any time one of the directional atoms or rigid |
| 889 |
> |
bodies has an orientation near $\theta=0$ or $\theta=\pi$. More |
| 890 |
> |
modern quaternion-based integration methods have relatively poor |
| 891 |
> |
energy conservation. While quaternions work well for orientational |
| 892 |
> |
motion in other ensembles, the microcanonical ensemble has a |
| 893 |
> |
constant energy requirement that is quite sensitive to errors in the |
| 894 |
> |
equations of motion. An earlier implementation of {\sc oopse} |
| 895 |
> |
utilized quaternions for propagation of rotational motion; however, a |
| 896 |
> |
detailed investigation showed that they resulted in a steady drift in |
| 897 |
> |
the total energy, something that has been observed by |
| 898 |
> |
Laird {\it et al.}\cite{Laird97} |
| 899 |
|
|
| 900 |
|
The key difference in the integration method proposed by Dullweber |
| 901 |
< |
\emph{et al}.~({\sc dlm}) is that the entire rotation matrix is propagated from |
| 902 |
< |
one time step to the next. In the past, this would not have been a |
| 903 |
< |
feasible option, since the rotation matrix for a single body is nine |
| 904 |
< |
elements long as opposed to three or four elements for Euler angles |
| 905 |
< |
and quaternions respectively. System memory has become much less of an |
| 906 |
< |
issue in recent times, and the {\sc dlm} method has used memory in |
| 907 |
< |
exchange for substantial benefits in energy conservation. |
| 901 |
> |
\emph{et al.} is that the entire $3 \times 3$ rotation matrix is |
| 902 |
> |
propagated from one time step to the next. In the past, this would not |
| 903 |
> |
have been feasible, since the rotation matrix for a single body has |
| 904 |
> |
nine elements compared with the more memory-efficient methods (using |
| 905 |
> |
three Euler angles or 4 quaternions). Computer memory has become much |
| 906 |
> |
less costly in recent years, and this can be translated into |
| 907 |
> |
substantial benefits in energy conservation. |
| 908 |
|
|
| 909 |
< |
The {\sc dlm} method allows for Verlet style integration of both |
| 910 |
< |
linear and angular motion of rigid bodies. In the integration method, |
| 911 |
< |
the orientational propagation involves a sequence of matrix |
| 912 |
< |
evaluations to update the rotation matrix.\cite{Dullweber1997} These |
| 913 |
< |
matrix rotations are more costly computationally than the simpler |
| 914 |
< |
arithmetic quaternion propagation. With the same time step, a 1000 SSD |
| 915 |
< |
particle simulation shows an average 7\% increase in computation time |
| 916 |
< |
using the {\sc dlm} method in place of quaternions. This cost is more |
| 917 |
< |
than justified when comparing the energy conservation of the two |
| 918 |
< |
methods as illustrated in Fig.~\ref{timestep}. |
| 909 |
> |
The basic equations of motion being integrated are derived from the |
| 910 |
> |
Hamiltonian for conservative systems containing rigid bodies, |
| 911 |
> |
\begin{equation} |
| 912 |
> |
H = \sum_{i} \left( \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i + |
| 913 |
> |
\frac{1}{2} {\bf j}_i^T \cdot \overleftrightarrow{\mathsf{I}}_i^{-1} \cdot |
| 914 |
> |
{\bf j}_i \right) + |
| 915 |
> |
V\left(\left\{{\bf r}\right\}, \left\{\mathsf{A}\right\}\right) |
| 916 |
> |
\end{equation} |
| 917 |
> |
where ${\bf r}_i$ and ${\bf v}_i$ are the cartesian position vector |
| 918 |
> |
and velocity of the center of mass of particle $i$, and ${\bf j}_i$ |
| 919 |
> |
and $\overleftrightarrow{\mathsf{I}}_i$ are the body-fixed angular |
| 920 |
> |
momentum and moment of inertia tensor, respectively. $\mathsf{A}_i$ |
| 921 |
> |
is the $3 \times 3$ rotation matrix describing the instantaneous |
| 922 |
> |
orientation of the particle. $V$ is the potential energy function |
| 923 |
> |
which may depend on both the positions $\left\{{\bf r}\right\}$ and |
| 924 |
> |
orientations $\left\{\mathsf{A}\right\}$ of all particles. The |
| 925 |
> |
equations of motion for the particle centers of mass are derived from |
| 926 |
> |
Hamilton's equations and are quite simple, |
| 927 |
> |
\begin{eqnarray} |
| 928 |
> |
\dot{{\bf r}} & = & {\bf v} \\ |
| 929 |
> |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} |
| 930 |
> |
\end{eqnarray} |
| 931 |
> |
where ${\bf f}$ is the instantaneous force on the center of mass |
| 932 |
> |
of the particle, |
| 933 |
> |
\begin{equation} |
| 934 |
> |
{\bf f} = - \frac{\partial}{\partial |
| 935 |
> |
{\bf r}} V(\left\{{\bf r}(t)\right\}, \left\{\mathsf{A}(t)\right\}). |
| 936 |
> |
\end{equation} |
| 937 |
> |
|
| 938 |
> |
The equations of motion for the orientational degrees of freedom are |
| 939 |
> |
\begin{eqnarray} |
| 940 |
> |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
| 941 |
> |
\mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right) \\ |
| 942 |
> |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1} |
| 943 |
> |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
| 944 |
> |
V}{\partial \mathsf{A}} \right) |
| 945 |
> |
\end{eqnarray} |
| 946 |
> |
In these equations of motion, the $\mbox{skew}$ matrix of a vector |
| 947 |
> |
${\bf v} = \left( v_1, v_2, v_3 \right)$ is defined: |
| 948 |
> |
\begin{equation} |
| 949 |
> |
\mbox{skew}\left( {\bf v} \right) := \left( |
| 950 |
> |
\begin{array}{ccc} |
| 951 |
> |
0 & v_3 & - v_2 \\ |
| 952 |
> |
-v_3 & 0 & v_1 \\ |
| 953 |
> |
v_2 & -v_1 & 0 |
| 954 |
> |
\end{array} |
| 955 |
> |
\right) |
| 956 |
> |
\end{equation} |
| 957 |
> |
The $\mbox{rot}$ notation refers to the mapping of the $3 \times 3$ |
| 958 |
> |
rotation matrix to a vector of orientations by first computing the |
| 959 |
> |
skew-symmetric part $\left(\mathsf{A} - \mathsf{A}^{T}\right)$ and |
| 960 |
> |
then associating this with a length 3 vector by inverting the |
| 961 |
> |
$\mbox{skew}$ function above: |
| 962 |
> |
\begin{equation} |
| 963 |
> |
\mbox{rot}\left(\mathsf{A}\right) := \mbox{ skew}^{-1}\left(\mathsf{A} |
| 964 |
> |
- \mathsf{A}^{T} \right) |
| 965 |
> |
\end{equation} |
| 966 |
> |
Written this way, the $\mbox{rot}$ operation creates a set of |
| 967 |
> |
conjugate angle coordinates to the body-fixed angular momenta |
| 968 |
> |
represented by ${\bf j}$. This equation of motion for angular momenta |
| 969 |
> |
is equivalent to the more familiar body-fixed forms, |
| 970 |
> |
\begin{eqnarray} |
| 971 |
> |
\dot{j_{x}} & = & \tau^b_x(t) + |
| 972 |
> |
\left(\overleftrightarrow{\mathsf{I}}_{yy} - \overleftrightarrow{\mathsf{I}}_{zz} \right) j_y j_z \\ |
| 973 |
> |
\dot{j_{y}} & = & \tau^b_y(t) + |
| 974 |
> |
\left(\overleftrightarrow{\mathsf{I}}_{zz} - \overleftrightarrow{\mathsf{I}}_{xx} \right) j_z j_x \\ |
| 975 |
> |
\dot{j_{z}} & = & \tau^b_z(t) + |
| 976 |
> |
\left(\overleftrightarrow{\mathsf{I}}_{xx} - \overleftrightarrow{\mathsf{I}}_{yy} \right) j_x j_y |
| 977 |
> |
\end{eqnarray} |
| 978 |
> |
which utilize the body-fixed torques, ${\bf \tau}^b$. Torques are |
| 979 |
> |
most easily derived in the space-fixed frame, |
| 980 |
> |
\begin{equation} |
| 981 |
> |
{\bf \tau}^b(t) = \mathsf{A}(t) \cdot {\bf \tau}^s(t) |
| 982 |
> |
\end{equation} |
| 983 |
> |
where the torques are either derived from the forces on the |
| 984 |
> |
constituent atoms of the rigid body, or for directional atoms, |
| 985 |
> |
directly from derivatives of the potential energy, |
| 986 |
> |
\begin{equation} |
| 987 |
> |
{\bf \tau}^s(t) = - \hat{\bf u}(t) \times \left( \frac{\partial} |
| 988 |
> |
{\partial \hat{\bf u}} V\left(\left\{ {\bf r}(t) \right\}, \left\{ |
| 989 |
> |
\mathsf{A}(t) \right\}\right) \right). |
| 990 |
> |
\end{equation} |
| 991 |
> |
Here $\hat{\bf u}$ is a unit vector pointing along the principal axis |
| 992 |
> |
of the particle in the space-fixed frame. |
| 993 |
> |
|
| 994 |
> |
The DLM method uses a Trotter factorization of the orientational |
| 995 |
> |
propagator. This has three effects: |
| 996 |
> |
\begin{enumerate} |
| 997 |
> |
\item the integrator is area-preserving in phase space (i.e. it is |
| 998 |
> |
{\it symplectic}), |
| 999 |
> |
\item the integrator is time-{\it reversible}, making it suitable for Hybrid |
| 1000 |
> |
Monte Carlo applications, and |
| 1001 |
> |
\item the error for a single time step is of order $O\left(h^3\right)$ |
| 1002 |
> |
for timesteps of length $h$. |
| 1003 |
> |
\end{enumerate} |
| 1004 |
> |
|
| 1005 |
> |
The integration of the equations of motion is carried out in a |
| 1006 |
> |
velocity-Verlet style 2-part algorithm: |
| 1007 |
> |
|
| 1008 |
> |
{\tt moveA:} |
| 1009 |
> |
\begin{eqnarray} |
| 1010 |
> |
{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf |
| 1011 |
> |
v}(t) + \frac{\delta t}{2} \left( {\bf f}(t) / m \right) \\ |
| 1012 |
> |
{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf |
| 1013 |
> |
v}\left(t + \delta t / 2 \right) \\ |
| 1014 |
> |
{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf |
| 1015 |
> |
j}(t) + \frac{\delta t}{2} {\bf \tau}^b(t) \\ |
| 1016 |
> |
\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left( \delta t |
| 1017 |
> |
{\bf j}(t + \delta t / 2) \cdot \overleftrightarrow{\mathsf{I}}^{-1} |
| 1018 |
> |
\right) |
| 1019 |
> |
\end{eqnarray} |
| 1020 |
> |
|
| 1021 |
> |
In this context, the $\mathrm{rot}$ function is the reversible product |
| 1022 |
> |
of the three body-fixed rotations, |
| 1023 |
> |
\begin{equation} |
| 1024 |
> |
\mathrm{rot}({\bf a}) = \mathsf{G}_x(a_x / 2) \cdot |
| 1025 |
> |
\mathsf{G}_y(a_y / 2) \cdot \mathsf{G}_z(a_z) \cdot \mathsf{G}_y(a_y / |
| 1026 |
> |
2) \cdot \mathsf{G}_x(a_x /2) |
| 1027 |
> |
\end{equation} |
| 1028 |
> |
where each rotational propagator, $\mathsf{G}_\alpha(\theta)$, rotates |
| 1029 |
> |
both the rotation matrix ($\mathsf{A}$) and the body-fixed angular |
| 1030 |
> |
momentum (${\bf j}$) by an angle $\theta$ around body-fixed axis |
| 1031 |
> |
$\alpha$, |
| 1032 |
> |
\begin{equation} |
| 1033 |
> |
\mathsf{G}_\alpha( \theta ) = \left\{ |
| 1034 |
> |
\begin{array}{lcl} |
| 1035 |
> |
\mathsf{A}(t) & \leftarrow & \mathsf{A}(0) \cdot \mathsf{R}_\alpha(\theta)^T \\ |
| 1036 |
> |
{\bf j}(t) & \leftarrow & \mathsf{R}_\alpha(\theta) \cdot {\bf j}(0) |
| 1037 |
> |
\end{array} |
| 1038 |
> |
\right. |
| 1039 |
> |
\end{equation} |
| 1040 |
> |
$\mathsf{R}_\alpha$ is a quadratic approximation to |
| 1041 |
> |
the single-axis rotation matrix. For example, in the small-angle |
| 1042 |
> |
limit, the rotation matrix around the body-fixed x-axis can be |
| 1043 |
> |
approximated as |
| 1044 |
> |
\begin{equation} |
| 1045 |
> |
\mathsf{R}_x(\theta) \approx \left( |
| 1046 |
> |
\begin{array}{ccc} |
| 1047 |
> |
1 & 0 & 0 \\ |
| 1048 |
> |
0 & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} & -\frac{\theta}{1+ |
| 1049 |
> |
\theta^2 / 4} \\ |
| 1050 |
> |
0 & \frac{\theta}{1+ |
| 1051 |
> |
\theta^2 / 4} & \frac{1-\theta^2 / 4}{1 + \theta^2 / 4} |
| 1052 |
> |
\end{array} |
| 1053 |
> |
\right). |
| 1054 |
> |
\end{equation} |
| 1055 |
> |
All other rotations follow in a straightforward manner. |
| 1056 |
|
|
| 1057 |
+ |
After the first part of the propagation, the forces and body-fixed |
| 1058 |
+ |
torques are calculated at the new positions and orientations |
| 1059 |
+ |
|
| 1060 |
+ |
{\tt doForces:} |
| 1061 |
+ |
\begin{eqnarray} |
| 1062 |
+ |
{\bf f}(t + \delta t) & \leftarrow & - \left(\frac{\partial V}{\partial {\bf |
| 1063 |
+ |
r}}\right)_{{\bf r}(t + \delta t)} \\ |
| 1064 |
+ |
{\bf \tau}^{s}(t + \delta t) & \leftarrow & {\bf u}(t + \delta t) |
| 1065 |
+ |
\times \frac{\partial V}{\partial {\bf u}} \\ |
| 1066 |
+ |
{\bf \tau}^{b}(t + \delta t) & \leftarrow & \mathsf{A}(t + \delta t) |
| 1067 |
+ |
\cdot {\bf \tau}^s(t + \delta t) |
| 1068 |
+ |
\end{eqnarray} |
| 1069 |
+ |
|
| 1070 |
+ |
{\sc oopse} automatically updates ${\bf u}$ when the rotation matrix |
| 1071 |
+ |
$\mathsf{A}$ is calculated in {\tt moveA}. Once the forces and |
| 1072 |
+ |
torques have been obtained at the new time step, the velocities can be |
| 1073 |
+ |
advanced to the same time value. |
| 1074 |
+ |
|
| 1075 |
+ |
{\tt moveB:} |
| 1076 |
+ |
\begin{eqnarray} |
| 1077 |
+ |
{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1078 |
+ |
v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( |
| 1079 |
+ |
{\bf f}(t + \delta t) / m \right) \\ |
| 1080 |
+ |
{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1081 |
+ |
j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} {\bf |
| 1082 |
+ |
\tau}^b(t + \delta t) |
| 1083 |
+ |
\end{eqnarray} |
| 1084 |
+ |
|
| 1085 |
+ |
The matrix rotations used in the DLM method end up being more costly |
| 1086 |
+ |
computationally than the simpler arithmetic quaternion |
| 1087 |
+ |
propagation. With the same time step, a 1000-molecule water simulation |
| 1088 |
+ |
shows an average 7\% increase in computation time using the DLM method |
| 1089 |
+ |
in place of quaternions. This cost is more than justified when |
| 1090 |
+ |
comparing the energy conservation of the two methods as illustrated in |
| 1091 |
+ |
figure \ref{timestep}. |
| 1092 |
+ |
|
| 1093 |
|
\begin{figure} |
| 1094 |
|
\centering |
| 1095 |
|
\includegraphics[width=\linewidth]{timeStep.eps} |
| 1096 |
< |
\caption[Energy conservation for quaternion versus {\sc dlm} dynamics]{Energy conservation using quaternion based integration versus |
| 1097 |
< |
the {\sc dlm} method with |
| 1098 |
< |
increasing time step. For each time step, the dotted line is total |
| 1099 |
< |
energy using the {\sc dlm} integrator, and the solid line comes |
| 1100 |
< |
from the quaternion integrator. The larger time step plots are shifted |
| 1101 |
< |
up from the true energy baseline for clarity.} |
| 1096 |
> |
\caption[Energy conservation for quaternion versus DLM dynamics]{Energy conservation using quaternion based integration versus |
| 1097 |
> |
the method proposed by Dullweber \emph{et al.} with increasing time |
| 1098 |
> |
step. For each time step, the dotted line is total energy using the |
| 1099 |
> |
DLM integrator, and the solid line comes from the quaternion |
| 1100 |
> |
integrator. The larger time step plots are shifted up from the true |
| 1101 |
> |
energy baseline for clarity.} |
| 1102 |
|
\label{timestep} |
| 1103 |
|
\end{figure} |
| 1104 |
|
|
| 1105 |
< |
In Fig.~\ref{timestep}, the resulting energy drift at various time |
| 1106 |
< |
steps for both the {\sc dlm} and quaternion integration schemes |
| 1107 |
< |
is compared. All of the 1000 SSD particle simulations started with the |
| 1105 |
> |
In figure \ref{timestep}, the resulting energy drift at various time |
| 1106 |
> |
steps for both the DLM and quaternion integration schemes is |
| 1107 |
> |
compared. All of the 1000 molecule water simulations started with the |
| 1108 |
|
same configuration, and the only difference was the method for |
| 1109 |
|
handling rotational motion. At time steps of 0.1 and 0.5 fs, both |
| 1110 |
< |
methods for propagating particle rotation conserve energy fairly well, |
| 1110 |
> |
methods for propagating molecule rotation conserve energy fairly well, |
| 1111 |
|
with the quaternion method showing a slight energy drift over time in |
| 1112 |
|
the 0.5 fs time step simulation. At time steps of 1 and 2 fs, the |
| 1113 |
< |
energy conservation benefits of the {\sc dlm} method are clearly |
| 1113 |
> |
energy conservation benefits of the DLM method are clearly |
| 1114 |
|
demonstrated. Thus, while maintaining the same degree of energy |
| 1115 |
|
conservation, one can take considerably longer time steps, leading to |
| 1116 |
|
an overall reduction in computation time. |
| 1117 |
|
|
| 1118 |
< |
Energy drift in these SSD particle simulations was unnoticeable for |
| 1119 |
< |
time steps up to three femtoseconds. A slight energy drift on the |
| 932 |
< |
order of 0.012 kcal/mol per nanosecond was observed at a time step of |
| 933 |
< |
four femtoseconds, and as expected, this drift increases dramatically |
| 934 |
< |
with increasing time step. |
| 1118 |
> |
There is only one specific keyword relevant to the default integrator, |
| 1119 |
> |
and that is the time step for integrating the equations of motion. |
| 1120 |
|
|
| 1121 |
+ |
\begin{center} |
| 1122 |
+ |
\begin{tabular}{llll} |
| 1123 |
+ |
{\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf |
| 1124 |
+ |
default value} \\ |
| 1125 |
+ |
$\delta t$ & {\tt dt = 2.0;} & fs & none |
| 1126 |
+ |
\end{tabular} |
| 1127 |
+ |
\end{center} |
| 1128 |
|
|
| 1129 |
|
\subsection{\label{sec:extended}Extended Systems for other Ensembles} |
| 1130 |
|
|
| 1131 |
+ |
{\sc oopse} implements a number of extended system integrators for |
| 1132 |
+ |
sampling from other ensembles relevant to chemical physics. The |
| 1133 |
+ |
integrator can selected with the {\tt ensemble} keyword in the |
| 1134 |
+ |
{\tt .bass} file: |
| 1135 |
|
|
| 1136 |
< |
{\sc oopse} implements a |
| 1136 |
> |
\begin{center} |
| 1137 |
> |
\begin{tabular}{lll} |
| 1138 |
> |
{\bf Integrator} & {\bf Ensemble} & {\bf {\tt .bass} line} \\ |
| 1139 |
> |
NVE & microcanonical & {\tt ensemble = ``NVE''; } \\ |
| 1140 |
> |
NVT & canonical & {\tt ensemble = ``NVT''; } \\ |
| 1141 |
> |
NPTi & isobaric-isothermal (with isotropic volume changes) & {\tt |
| 1142 |
> |
ensemble = ``NPTi'';} \\ |
| 1143 |
> |
NPTf & isobaric-isothermal (with changes to box shape) & {\tt |
| 1144 |
> |
ensemble = ``NPTf'';} \\ |
| 1145 |
> |
NPTxyz & approximate isobaric-isothermal & {\tt ensemble = |
| 1146 |
> |
``NPTxyz'';} \\ |
| 1147 |
> |
& (with separate barostats on each box dimension) & |
| 1148 |
> |
\end{tabular} |
| 1149 |
> |
\end{center} |
| 1150 |
|
|
| 1151 |
+ |
The relatively well-known Nos\'e-Hoover thermostat is implemented in |
| 1152 |
+ |
{\sc oopse}'s NVT integrator. This method couples an extra degree of |
| 1153 |
+ |
freedom (the thermostat) to the kinetic energy of the system, and has |
| 1154 |
+ |
been shown to sample the canonical distribution in the system degrees |
| 1155 |
+ |
of freedom while conserving a quantity that is, to within a constant, |
| 1156 |
+ |
the Helmholtz free energy. |
| 1157 |
|
|
| 1158 |
< |
\subsection{\label{oopseSec:noseHooverThermo}Nose-Hoover Thermostatting} |
| 1158 |
> |
NPT algorithms attempt to maintain constant pressure in the system by |
| 1159 |
> |
coupling the volume of the system to a barostat. {\sc oopse} contains |
| 1160 |
> |
three different constant pressure algorithms. The first two, NPTi and |
| 1161 |
> |
NPTf have been shown to conserve a quantity that is, to within a |
| 1162 |
> |
constant, the Gibbs free energy. The Melchionna modification to the |
| 1163 |
> |
Hoover barostat is implemented in both NPTi and NPTf. NPTi allows |
| 1164 |
> |
only isotropic changes in the simulation box, while box {\it shape} |
| 1165 |
> |
variations are allowed in NPTf. The NPTxyz integrator has {\it not} |
| 1166 |
> |
been shown to sample from the isobaric-isothermal ensemble. It is |
| 1167 |
> |
useful, however, in that it maintains orthogonality for the axes of |
| 1168 |
> |
the simulation box while attempting to equalize pressure along the |
| 1169 |
> |
three perpendicular directions in the box. |
| 1170 |
|
|
| 1171 |
< |
To mimic the effects of being in a constant temperature ({\sc nvt}) |
| 1172 |
< |
ensemble, {\sc oopse} uses the Nose-Hoover extended system |
| 1173 |
< |
approach.\cite{Hoover85} In this method, the equations of motion for |
| 1174 |
< |
the particle positions and velocities are |
| 1171 |
> |
Each of the extended system integrators requires additional keywords |
| 1172 |
> |
to set target values for the thermodynamic state variables that are |
| 1173 |
> |
being held constant. Keywords are also required to set the |
| 1174 |
> |
characteristic decay times for the dynamics of the extended |
| 1175 |
> |
variables. |
| 1176 |
> |
|
| 1177 |
> |
\begin{tabular}{llll} |
| 1178 |
> |
{\bf variable} & {\bf {\tt .bass} keyword} & {\bf units} & {\bf |
| 1179 |
> |
default value} \\ |
| 1180 |
> |
$T_{\mathrm{target}}$ & {\tt targetTemperature = 300;} & K & none \\ |
| 1181 |
> |
$P_{\mathrm{target}}$ & {\tt targetPressure = 1;} & atm & none \\ |
| 1182 |
> |
$\tau_T$ & {\tt tauThermostat = 1e3;} & fs & none \\ |
| 1183 |
> |
$\tau_B$ & {\tt tauBarostat = 5e3;} & fs & none \\ |
| 1184 |
> |
& {\tt resetTime = 200;} & fs & none \\ |
| 1185 |
> |
& {\tt useInitialExtendedSystemState = ``true'';} & logical & |
| 1186 |
> |
false |
| 1187 |
> |
\end{tabular} |
| 1188 |
> |
|
| 1189 |
> |
Two additional keywords can be used to either clear the extended |
| 1190 |
> |
system variables periodically ({\tt resetTime}), or to maintain the |
| 1191 |
> |
state of the extended system variables between simulations ({\tt |
| 1192 |
> |
useInitialExtendedSystemState}). More details on these variables |
| 1193 |
> |
and their use in the integrators follows below. |
| 1194 |
> |
|
| 1195 |
> |
\subsubsection{\label{oopseSec:noseHooverThermo}Nos\'{e}-Hoover Thermostatting} |
| 1196 |
> |
|
| 1197 |
> |
The Nos\'e-Hoover equations of motion are given by\cite{Hoover85} |
| 1198 |
|
\begin{eqnarray} |
| 1199 |
|
\dot{{\bf r}} & = & {\bf v} \\ |
| 1200 |
< |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} |
| 1200 |
> |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - \chi {\bf v} \\ |
| 1201 |
> |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
| 1202 |
> |
\mbox{ skew}\left(\overleftrightarrow{\mathsf{I}}^{-1} \cdot {\bf j}\right) \\ |
| 1203 |
> |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{\mathsf{I}}^{-1} |
| 1204 |
> |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
| 1205 |
> |
V}{\partial \mathsf{A}} \right) - \chi {\bf j} |
| 1206 |
|
\label{eq:nosehoovereom} |
| 1207 |
|
\end{eqnarray} |
| 1208 |
|
|
| 1209 |
|
$\chi$ is an ``extra'' variable included in the extended system, and |
| 1210 |
|
it is propagated using the first order equation of motion |
| 1211 |
|
\begin{equation} |
| 1212 |
< |
\dot{\chi} = \frac{1}{\tau_{T}} \left( \frac{T}{T_{target}} - 1 \right) |
| 1212 |
> |
\dot{\chi} = \frac{1}{\tau_{T}^2} \left( \frac{T}{T_{\mathrm{target}}} - 1 \right). |
| 1213 |
|
\label{eq:nosehooverext} |
| 1214 |
|
\end{equation} |
| 961 |
– |
where $T_{target}$ is the target temperature for the simulation, and |
| 962 |
– |
$\tau_{T}$ is a time constant for the thermostat. |
| 1215 |
|
|
| 1216 |
< |
To select the Nose-Hoover {\sc nvt} ensemble, the {\tt ensemble = NVT;} |
| 1217 |
< |
command would be used in the simulation's {\sc bass} file. There is |
| 1218 |
< |
some subtlety in choosing values for $\tau_{T}$, and it is usually set |
| 1219 |
< |
to values of a few ps. Within a {\sc bass} file, $\tau_{T}$ could be |
| 1220 |
< |
set to 1 ps using the {\tt tauThermostat = 1000; } command. |
| 1216 |
> |
The instantaneous temperature $T$ is proportional to the total kinetic |
| 1217 |
> |
energy (both translational and orientational) and is given by |
| 1218 |
> |
\begin{equation} |
| 1219 |
> |
T = \frac{2 K}{f k_B} |
| 1220 |
> |
\end{equation} |
| 1221 |
> |
Here, $f$ is the total number of degrees of freedom in the system, |
| 1222 |
> |
\begin{equation} |
| 1223 |
> |
f = 3 N + 3 N_{\mathrm{orient}} - N_{\mathrm{constraints}} |
| 1224 |
> |
\end{equation} |
| 1225 |
> |
and $K$ is the total kinetic energy, |
| 1226 |
> |
\begin{equation} |
| 1227 |
> |
K = \sum_{i=1}^{N} \frac{1}{2} m_i {\bf v}_i^T \cdot {\bf v}_i + |
| 1228 |
> |
\sum_{i=1}^{N_{\mathrm{orient}}} \frac{1}{2} {\bf j}_i^T \cdot |
| 1229 |
> |
\overleftrightarrow{\mathsf{I}}_i^{-1} \cdot {\bf j}_i |
| 1230 |
> |
\end{equation} |
| 1231 |
|
|
| 1232 |
+ |
In eq.(\ref{eq:nosehooverext}), $\tau_T$ is the time constant for |
| 1233 |
+ |
relaxation of the temperature to the target value. To set values for |
| 1234 |
+ |
$\tau_T$ or $T_{\mathrm{target}}$ in a simulation, one would use the |
| 1235 |
+ |
{\tt tauThermostat} and {\tt targetTemperature} keywords in the {\tt |
| 1236 |
+ |
.bass} file. The units for {\tt tauThermostat} are fs, and the units |
| 1237 |
+ |
for the {\tt targetTemperature} are degrees K. The integration of |
| 1238 |
+ |
the equations of motion is carried out in a velocity-Verlet style 2 |
| 1239 |
+ |
part algorithm: |
| 1240 |
+ |
|
| 1241 |
+ |
{\tt moveA:} |
| 1242 |
+ |
\begin{eqnarray} |
| 1243 |
+ |
T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\ |
| 1244 |
+ |
{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf |
| 1245 |
+ |
v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) |
| 1246 |
+ |
\chi(t)\right) \\ |
| 1247 |
+ |
{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t {\bf |
| 1248 |
+ |
v}\left(t + \delta t / 2 \right) \\ |
| 1249 |
+ |
{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf |
| 1250 |
+ |
j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) |
| 1251 |
+ |
\chi(t) \right) \\ |
| 1252 |
+ |
\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * |
| 1253 |
+ |
{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ |
| 1254 |
+ |
\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + |
| 1255 |
+ |
\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 |
| 1256 |
+ |
\right) |
| 1257 |
+ |
\end{eqnarray} |
| 1258 |
+ |
|
| 1259 |
+ |
Here $\mathrm{rot}(\delta t * {\bf j} |
| 1260 |
+ |
\overleftrightarrow{\mathsf{I}}^{-1})$ is the same symplectic Trotter |
| 1261 |
+ |
factorization of the three rotation operations that was discussed in |
| 1262 |
+ |
the section on the DLM integrator. Note that this operation modifies |
| 1263 |
+ |
both the rotation matrix $\mathsf{A}$ and the angular momentum ${\bf |
| 1264 |
+ |
j}$. {\tt moveA} propagates velocities by a half time step, and |
| 1265 |
+ |
positional degrees of freedom by a full time step. The new positions |
| 1266 |
+ |
(and orientations) are then used to calculate a new set of forces and |
| 1267 |
+ |
torques in exactly the same way they are calculated in the {\tt |
| 1268 |
+ |
doForces} portion of the DLM integrator. |
| 1269 |
+ |
|
| 1270 |
+ |
Once the forces and torques have been obtained at the new time step, |
| 1271 |
+ |
the temperature, velocities, and the extended system variable can be |
| 1272 |
+ |
advanced to the same time value. |
| 1273 |
+ |
|
| 1274 |
+ |
{\tt moveB:} |
| 1275 |
+ |
\begin{eqnarray} |
| 1276 |
+ |
T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, |
| 1277 |
+ |
\left\{{\bf j}(t + \delta t)\right\} \\ |
| 1278 |
+ |
\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / |
| 1279 |
+ |
2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta |
| 1280 |
+ |
t)}{T_{\mathrm{target}}} - 1 \right) \\ |
| 1281 |
+ |
{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1282 |
+ |
v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( |
| 1283 |
+ |
\frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t) |
| 1284 |
+ |
\chi(t \delta t)\right) \\ |
| 1285 |
+ |
{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1286 |
+ |
j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf |
| 1287 |
+ |
\tau}^b(t + \delta t) - {\bf j}(t + \delta t) |
| 1288 |
+ |
\chi(t + \delta t) \right) |
| 1289 |
+ |
\end{eqnarray} |
| 1290 |
+ |
|
| 1291 |
+ |
Since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$ are required |
| 1292 |
+ |
to caclculate $T(t + \delta t)$ as well as $\chi(t + \delta t)$, they |
| 1293 |
+ |
indirectly depend on their own values at time $t + \delta t$. {\tt |
| 1294 |
+ |
moveB} is therefore done in an iterative fashion until $\chi(t + |
| 1295 |
+ |
\delta t)$ becomes self-consistent. The relative tolerance for the |
| 1296 |
+ |
self-consistency check defaults to a value of $\mbox{10}^{-6}$, but |
| 1297 |
+ |
{\sc oopse} will terminate the iteration after 4 loops even if the |
| 1298 |
+ |
consistency check has not been satisfied. |
| 1299 |
+ |
|
| 1300 |
+ |
The Nos\'e-Hoover algorithm is known to conserve a Hamiltonian for the |
| 1301 |
+ |
extended system that is, to within a constant, identical to the |
| 1302 |
+ |
Helmholtz free energy, |
| 1303 |
+ |
\begin{equation} |
| 1304 |
+ |
H_{\mathrm{NVT}} = V + K + f k_B T_{\mathrm{target}} \left( |
| 1305 |
+ |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
| 1306 |
+ |
\right) |
| 1307 |
+ |
\end{equation} |
| 1308 |
+ |
Poor choices of $\delta t$ or $\tau_T$ can result in non-conservation |
| 1309 |
+ |
of $H_{\mathrm{NVT}}$, so the conserved quantity is maintained in the |
| 1310 |
+ |
last column of the {\tt .stat} file to allow checks on the quality of |
| 1311 |
+ |
the integration. |
| 1312 |
+ |
|
| 1313 |
+ |
Bond constraints are applied at the end of both the {\tt moveA} and |
| 1314 |
+ |
{\tt moveB} portions of the algorithm. Details on the constraint |
| 1315 |
+ |
algorithms are given in section \ref{oopseSec:rattle}. |
| 1316 |
+ |
|
| 1317 |
+ |
\subsubsection{\label{sec:NPTi}Constant-pressure integration with |
| 1318 |
+ |
isotropic box deformations (NPTi)} |
| 1319 |
+ |
|
| 1320 |
+ |
To carry out isobaric-isothermal ensemble calculations {\sc oopse} |
| 1321 |
+ |
implements the Melchionna modifications to the Nos\'e-Hoover-Andersen |
| 1322 |
+ |
equations of motion,\cite{melchionna93} |
| 1323 |
+ |
|
| 1324 |
+ |
\begin{eqnarray} |
| 1325 |
+ |
\dot{{\bf r}} & = & {\bf v} + \eta \left( {\bf r} - {\bf R}_0 \right) \\ |
| 1326 |
+ |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\eta + \chi) {\bf v} \\ |
| 1327 |
+ |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
| 1328 |
+ |
\mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) \\ |
| 1329 |
+ |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1} |
| 1330 |
+ |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
| 1331 |
+ |
V}{\partial \mathsf{A}} \right) - \chi {\bf j} \\ |
| 1332 |
+ |
\dot{\chi} & = & \frac{1}{\tau_{T}^2} \left( |
| 1333 |
+ |
\frac{T}{T_{\mathrm{target}}} - 1 \right) \\ |
| 1334 |
+ |
\dot{\eta} & = & \frac{1}{\tau_{B}^2 f k_B T_{\mathrm{target}}} V \left( P - |
| 1335 |
+ |
P_{\mathrm{target}} \right) \\ |
| 1336 |
+ |
\dot{\mathcal{V}} & = & 3 \mathcal{V} \eta |
| 1337 |
+ |
\label{eq:melchionna1} |
| 1338 |
+ |
\end{eqnarray} |
| 1339 |
+ |
|
| 1340 |
+ |
$\chi$ and $\eta$ are the ``extra'' degrees of freedom in the extended |
| 1341 |
+ |
system. $\chi$ is a thermostat, and it has the same function as it |
| 1342 |
+ |
does in the Nos\'e-Hoover NVT integrator. $\eta$ is a barostat which |
| 1343 |
+ |
controls changes to the volume of the simulation box. ${\bf R}_0$ is |
| 1344 |
+ |
the location of the center of mass for the entire system, and |
| 1345 |
+ |
$\mathcal{V}$ is the volume of the simulation box. At any time, the |
| 1346 |
+ |
volume can be calculated from the determinant of the matrix which |
| 1347 |
+ |
describes the box shape: |
| 1348 |
+ |
\begin{equation} |
| 1349 |
+ |
\mathcal{V} = \det(\mathsf{H}) |
| 1350 |
+ |
\end{equation} |
| 1351 |
+ |
|
| 1352 |
+ |
The NPTi integrator requires an instantaneous pressure. This quantity |
| 1353 |
+ |
is calculated via the pressure tensor, |
| 1354 |
+ |
\begin{equation} |
| 1355 |
+ |
\overleftrightarrow{\mathsf{P}}(t) = \frac{1}{\mathcal{V}(t)} \left( |
| 1356 |
+ |
\sum_{i=1}^{N} m_i {\bf v}_i(t) \otimes {\bf v}_i(t) \right) + |
| 1357 |
+ |
\overleftrightarrow{\mathsf{W}}(t) |
| 1358 |
+ |
\end{equation} |
| 1359 |
+ |
The kinetic contribution to the pressure tensor utilizes the {\it |
| 1360 |
+ |
outer} product of the velocities denoted by the $\otimes$ symbol. The |
| 1361 |
+ |
stress tensor is calculated from another outer product of the |
| 1362 |
+ |
inter-atomic separation vectors (${\bf r}_{ij} = {\bf r}_j - {\bf |
| 1363 |
+ |
r}_i$) with the forces between the same two atoms, |
| 1364 |
+ |
\begin{equation} |
| 1365 |
+ |
\overleftrightarrow{\mathsf{W}}(t) = \sum_{i} \sum_{j>i} {\bf r}_{ij}(t) |
| 1366 |
+ |
\otimes {\bf f}_{ij}(t) |
| 1367 |
+ |
\end{equation} |
| 1368 |
+ |
The instantaneous pressure is then simply obtained from the trace of |
| 1369 |
+ |
the Pressure tensor, |
| 1370 |
+ |
\begin{equation} |
| 1371 |
+ |
P(t) = \frac{1}{3} \mathrm{Tr} \left( \overleftrightarrow{\mathsf{P}}(t) |
| 1372 |
+ |
\right) |
| 1373 |
+ |
\end{equation} |
| 1374 |
+ |
|
| 1375 |
+ |
In eq.(\ref{eq:melchionna1}), $\tau_B$ is the time constant for |
| 1376 |
+ |
relaxation of the pressure to the target value. To set values for |
| 1377 |
+ |
$\tau_B$ or $P_{\mathrm{target}}$ in a simulation, one would use the |
| 1378 |
+ |
{\tt tauBarostat} and {\tt targetPressure} keywords in the {\tt .bass} |
| 1379 |
+ |
file. The units for {\tt tauBarostat} are fs, and the units for the |
| 1380 |
+ |
{\tt targetPressure} are atmospheres. Like in the NVT integrator, the |
| 1381 |
+ |
integration of the equations of motion is carried out in a |
| 1382 |
+ |
velocity-Verlet style 2 part algorithm: |
| 1383 |
+ |
|
| 1384 |
+ |
{\tt moveA:} |
| 1385 |
+ |
\begin{eqnarray} |
| 1386 |
+ |
T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\ |
| 1387 |
+ |
P(t) & \leftarrow & \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\}, \left\{{\bf f}(t)\right\} \\ |
| 1388 |
+ |
{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf |
| 1389 |
+ |
v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - {\bf v}(t) |
| 1390 |
+ |
\left(\chi(t) + \eta(t) \right) \right) \\ |
| 1391 |
+ |
{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf |
| 1392 |
+ |
j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) |
| 1393 |
+ |
\chi(t) \right) \\ |
| 1394 |
+ |
\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * |
| 1395 |
+ |
{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ |
| 1396 |
+ |
\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + |
| 1397 |
+ |
\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 |
| 1398 |
+ |
\right) \\ |
| 1399 |
+ |
\eta(t + \delta t / 2) & \leftarrow & \eta(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B |
| 1400 |
+ |
T(t) \tau_B^2} \left( P(t) - P_{\mathrm{target}} \right) \\ |
| 1401 |
+ |
{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf |
| 1402 |
+ |
v}\left(t + \delta t / 2 \right) + \eta(t + \delta t / 2)\left[ {\bf |
| 1403 |
+ |
r}(t + \delta t) - {\bf R}_0 \right] \right\} \\ |
| 1404 |
+ |
\mathsf{H}(t + \delta t) & \leftarrow & e^{-\delta t \eta(t + \delta t |
| 1405 |
+ |
/ 2)} \mathsf{H}(t) |
| 1406 |
+ |
\end{eqnarray} |
| 1407 |
+ |
|
| 1408 |
+ |
Most of these equations are identical to their counterparts in the NVT |
| 1409 |
+ |
integrator, but the propagation of positions to time $t + \delta t$ |
| 1410 |
+ |
depends on the positions at the same time. {\sc oopse} carries out |
| 1411 |
+ |
this step iteratively (with a limit of 5 passes through the iterative |
| 1412 |
+ |
loop). Also, the simulation box $\mathsf{H}$ is scaled uniformly for |
| 1413 |
+ |
one full time step by an exponential factor that depends on the value |
| 1414 |
+ |
of $\eta$ at time $t + |
| 1415 |
+ |
\delta t / 2$. Reshaping the box uniformly also scales the volume of |
| 1416 |
+ |
the box by |
| 1417 |
+ |
\begin{equation} |
| 1418 |
+ |
\mathcal{V}(t + \delta t) \leftarrow e^{ - 3 \delta t \eta(t + \delta t /2)} |
| 1419 |
+ |
\mathcal{V}(t) |
| 1420 |
+ |
\end{equation} |
| 1421 |
+ |
|
| 1422 |
+ |
The {\tt doForces} step for the NPTi integrator is exactly the same as |
| 1423 |
+ |
in both the DLM and NVT integrators. Once the forces and torques have |
| 1424 |
+ |
been obtained at the new time step, the velocities can be advanced to |
| 1425 |
+ |
the same time value. |
| 1426 |
+ |
|
| 1427 |
+ |
{\tt moveB:} |
| 1428 |
+ |
\begin{eqnarray} |
| 1429 |
+ |
T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, |
| 1430 |
+ |
\left\{{\bf j}(t + \delta t)\right\} \\ |
| 1431 |
+ |
P(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\}, |
| 1432 |
+ |
\left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\ |
| 1433 |
+ |
\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / |
| 1434 |
+ |
2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta |
| 1435 |
+ |
t)}{T_{\mathrm{target}}} - 1 \right) \\ |
| 1436 |
+ |
\eta(t + \delta t) & \leftarrow & \eta(t + \delta t / 2) + |
| 1437 |
+ |
\frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2} |
| 1438 |
+ |
\left( P(t + \delta t) - P_{\mathrm{target}} |
| 1439 |
+ |
\right) \\ |
| 1440 |
+ |
{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1441 |
+ |
v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( |
| 1442 |
+ |
\frac{{\bf f}(t + \delta t)}{m} - {\bf v}(t + \delta t) |
| 1443 |
+ |
(\chi(t + \delta t) + \eta(t + \delta t)) \right) \\ |
| 1444 |
+ |
{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1445 |
+ |
j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf |
| 1446 |
+ |
\tau}^b(t + \delta t) - {\bf j}(t + \delta t) |
| 1447 |
+ |
\chi(t + \delta t) \right) |
| 1448 |
+ |
\end{eqnarray} |
| 1449 |
+ |
|
| 1450 |
+ |
Once again, since ${\bf v}(t + \delta t)$ and ${\bf j}(t + \delta t)$ |
| 1451 |
+ |
are required to caclculate $T(t + \delta t)$, $P(t + \delta t)$, $\chi(t + |
| 1452 |
+ |
\delta t)$, and $\eta(t + \delta t)$, they indirectly depend on their |
| 1453 |
+ |
own values at time $t + \delta t$. {\tt moveB} is therefore done in |
| 1454 |
+ |
an iterative fashion until $\chi(t + \delta t)$ and $\eta(t + \delta |
| 1455 |
+ |
t)$ become self-consistent. The relative tolerance for the |
| 1456 |
+ |
self-consistency check defaults to a value of $\mbox{10}^{-6}$, but |
| 1457 |
+ |
{\sc oopse} will terminate the iteration after 4 loops even if the |
| 1458 |
+ |
consistency check has not been satisfied. |
| 1459 |
+ |
|
| 1460 |
+ |
The Melchionna modification of the Nos\'e-Hoover-Andersen algorithm is |
| 1461 |
+ |
known to conserve a Hamiltonian for the extended system that is, to |
| 1462 |
+ |
within a constant, identical to the Gibbs free energy, |
| 1463 |
+ |
\begin{equation} |
| 1464 |
+ |
H_{\mathrm{NPTi}} = V + K + f k_B T_{\mathrm{target}} \left( |
| 1465 |
+ |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
| 1466 |
+ |
\right) + P_{\mathrm{target}} \mathcal{V}(t). |
| 1467 |
+ |
\end{equation} |
| 1468 |
+ |
Poor choices of $\delta t$, $\tau_T$, or $\tau_B$ can result in |
| 1469 |
+ |
non-conservation of $H_{\mathrm{NPTi}}$, so the conserved quantity is |
| 1470 |
+ |
maintained in the last column of the {\tt .stat} file to allow checks |
| 1471 |
+ |
on the quality of the integration. It is also known that this |
| 1472 |
+ |
algorithm samples the equilibrium distribution for the enthalpy |
| 1473 |
+ |
(including contributions for the thermostat and barostat), |
| 1474 |
+ |
\begin{equation} |
| 1475 |
+ |
H_{\mathrm{NPTi}} = V + K + \frac{f k_B T_{\mathrm{target}}}{2} \left( |
| 1476 |
+ |
\chi^2 \tau_T^2 + \eta^2 \tau_B^2 \right) + P_{\mathrm{target}} |
| 1477 |
+ |
\mathcal{V}(t). |
| 1478 |
+ |
\end{equation} |
| 1479 |
+ |
|
| 1480 |
+ |
Bond constraints are applied at the end of both the {\tt moveA} and |
| 1481 |
+ |
{\tt moveB} portions of the algorithm. Details on the constraint |
| 1482 |
+ |
algorithms are given in section \ref{oopseSec:rattle}. |
| 1483 |
+ |
|
| 1484 |
+ |
\subsubsection{\label{sec:NPTf}Constant-pressure integration with a |
| 1485 |
+ |
flexible box (NPTf)} |
| 1486 |
+ |
|
| 1487 |
+ |
There is a relatively simple generalization of the |
| 1488 |
+ |
Nos\'e-Hoover-Andersen method to include changes in the simulation box |
| 1489 |
+ |
{\it shape} as well as in the volume of the box. This method utilizes |
| 1490 |
+ |
the full $3 \times 3$ pressure tensor and introduces a tensor of |
| 1491 |
+ |
extended variables ($\overleftrightarrow{\eta}$) to control changes to |
| 1492 |
+ |
the box shape. The equations of motion for this method are |
| 1493 |
+ |
\begin{eqnarray} |
| 1494 |
+ |
\dot{{\bf r}} & = & {\bf v} + \overleftrightarrow{\eta} \cdot \left( {\bf r} - {\bf R}_0 \right) \\ |
| 1495 |
+ |
\dot{{\bf v}} & = & \frac{{\bf f}}{m} - (\overleftrightarrow{\eta} + |
| 1496 |
+ |
\chi \mathsf{1}) {\bf v} \\ |
| 1497 |
+ |
\dot{\mathsf{A}} & = & \mathsf{A} \cdot |
| 1498 |
+ |
\mbox{ skew}\left(\overleftrightarrow{I}^{-1} \cdot {\bf j}\right) \\ |
| 1499 |
+ |
\dot{{\bf j}} & = & {\bf j} \times \left( \overleftrightarrow{I}^{-1} |
| 1500 |
+ |
\cdot {\bf j} \right) - \mbox{ rot}\left(\mathsf{A}^{T} \cdot \frac{\partial |
| 1501 |
+ |
V}{\partial \mathsf{A}} \right) - \chi {\bf j} \\ |
| 1502 |
+ |
\dot{\chi} & = & \frac{1}{\tau_{T}^2} \left( |
| 1503 |
+ |
\frac{T}{T_{\mathrm{target}}} - 1 \right) \\ |
| 1504 |
+ |
\dot{\overleftrightarrow{eta}} & = & \frac{1}{\tau_{B}^2 f k_B |
| 1505 |
+ |
T_{\mathrm{target}}} V \left( \overleftrightarrow{\mathsf{P}} - P_{\mathrm{target}}\mathsf{1} \right) \\ |
| 1506 |
+ |
\dot{\mathsf{H}} & = & \overleftrightarrow{\eta} \cdot \mathsf{H} |
| 1507 |
+ |
\label{eq:melchionna2} |
| 1508 |
+ |
\end{eqnarray} |
| 1509 |
+ |
|
| 1510 |
+ |
Here, $\mathsf{1}$ is the unit matrix and $\overleftrightarrow{\mathsf{P}}$ |
| 1511 |
+ |
is the pressure tensor. Again, the volume, $\mathcal{V} = \det |
| 1512 |
+ |
\mathsf{H}$. |
| 1513 |
+ |
|
| 1514 |
+ |
The propagation of the equations of motion is nearly identical to the |
| 1515 |
+ |
NPTi integration: |
| 1516 |
+ |
|
| 1517 |
+ |
{\tt moveA:} |
| 1518 |
+ |
\begin{eqnarray} |
| 1519 |
+ |
T(t) & \leftarrow & \left\{{\bf v}(t)\right\}, \left\{{\bf j}(t)\right\} \\ |
| 1520 |
+ |
\overleftrightarrow{\mathsf{P}}(t) & \leftarrow & \left\{{\bf r}(t)\right\}, \left\{{\bf v}(t)\right\}, \left\{{\bf f}(t)\right\} \\ |
| 1521 |
+ |
{\bf v}\left(t + \delta t / 2\right) & \leftarrow & {\bf |
| 1522 |
+ |
v}(t) + \frac{\delta t}{2} \left( \frac{{\bf f}(t)}{m} - |
| 1523 |
+ |
\left(\chi(t)\mathsf{1} + \overleftrightarrow{\eta}(t) \right) \cdot |
| 1524 |
+ |
{\bf v}(t) \right) \\ |
| 1525 |
+ |
{\bf j}\left(t + \delta t / 2 \right) & \leftarrow & {\bf |
| 1526 |
+ |
j}(t) + \frac{\delta t}{2} \left( {\bf \tau}^b(t) - {\bf j}(t) |
| 1527 |
+ |
\chi(t) \right) \\ |
| 1528 |
+ |
\mathsf{A}(t + \delta t) & \leftarrow & \mathrm{rot}\left(\delta t * |
| 1529 |
+ |
{\bf j}(t + \delta t / 2) \overleftrightarrow{\mathsf{I}}^{-1} \right) \\ |
| 1530 |
+ |
\chi\left(t + \delta t / 2 \right) & \leftarrow & \chi(t) + |
| 1531 |
+ |
\frac{\delta t}{2 \tau_T^2} \left( \frac{T(t)}{T_{\mathrm{target}}} - 1 |
| 1532 |
+ |
\right) \\ |
| 1533 |
+ |
\overleftrightarrow{\eta}(t + \delta t / 2) & \leftarrow & \overleftrightarrow{\eta}(t) + \frac{\delta t \mathcal{V}(t)}{2 N k_B |
| 1534 |
+ |
T(t) \tau_B^2} \left( \overleftrightarrow{\mathsf{P}}(t) - P_{\mathrm{target}}\mathsf{1} \right) \\ |
| 1535 |
+ |
{\bf r}(t + \delta t) & \leftarrow & {\bf r}(t) + \delta t \left\{ {\bf |
| 1536 |
+ |
v}\left(t + \delta t / 2 \right) + \overleftrightarrow{\eta}(t + |
| 1537 |
+ |
\delta t / 2) \cdot \left[ {\bf |
| 1538 |
+ |
r}(t + \delta t) - {\bf R}_0 \right] \right\} \\ |
| 1539 |
+ |
\mathsf{H}(t + \delta t) & \leftarrow & \mathsf{H}(t) \cdot e^{-\delta t |
| 1540 |
+ |
\overleftrightarrow{\eta}(t + \delta t / 2)} |
| 1541 |
+ |
\end{eqnarray} |
| 1542 |
+ |
{\sc oopse} uses a power series expansion truncated at second order |
| 1543 |
+ |
for the exponential operation which scales the simulation box. |
| 1544 |
+ |
|
| 1545 |
+ |
The {\tt moveB} portion of the algorithm is largely unchanged from the |
| 1546 |
+ |
NPTi integrator: |
| 1547 |
+ |
|
| 1548 |
+ |
{\tt moveB:} |
| 1549 |
+ |
\begin{eqnarray} |
| 1550 |
+ |
T(t + \delta t) & \leftarrow & \left\{{\bf v}(t + \delta t)\right\}, |
| 1551 |
+ |
\left\{{\bf j}(t + \delta t)\right\} \\ |
| 1552 |
+ |
\overleftrightarrow{\mathsf{P}}(t + \delta t) & \leftarrow & \left\{{\bf r}(t + \delta t)\right\}, |
| 1553 |
+ |
\left\{{\bf v}(t + \delta t)\right\}, \left\{{\bf f}(t + \delta t)\right\} \\ |
| 1554 |
+ |
\chi\left(t + \delta t \right) & \leftarrow & \chi\left(t + \delta t / |
| 1555 |
+ |
2 \right) + \frac{\delta t}{2 \tau_T^2} \left( \frac{T(t+\delta |
| 1556 |
+ |
t)}{T_{\mathrm{target}}} - 1 \right) \\ |
| 1557 |
+ |
\overleftrightarrow{\eta}(t + \delta t) & \leftarrow & \overleftrightarrow{\eta}(t + \delta t / 2) + |
| 1558 |
+ |
\frac{\delta t \mathcal{V}(t + \delta t)}{2 N k_B T(t + \delta t) \tau_B^2} |
| 1559 |
+ |
\left( \overleftrightarrow{P}(t + \delta t) - P_{\mathrm{target}}\mathsf{1} |
| 1560 |
+ |
\right) \\ |
| 1561 |
+ |
{\bf v}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1562 |
+ |
v}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( |
| 1563 |
+ |
\frac{{\bf f}(t + \delta t)}{m} - |
| 1564 |
+ |
(\chi(t + \delta t)\mathsf{1} + \overleftrightarrow{\eta}(t + \delta |
| 1565 |
+ |
t)) \right) \cdot {\bf v}(t + \delta t) \\ |
| 1566 |
+ |
{\bf j}\left(t + \delta t \right) & \leftarrow & {\bf |
| 1567 |
+ |
j}\left(t + \delta t / 2 \right) + \frac{\delta t}{2} \left( {\bf |
| 1568 |
+ |
\tau}^b(t + \delta t) - {\bf j}(t + \delta t) |
| 1569 |
+ |
\chi(t + \delta t) \right) |
| 1570 |
+ |
\end{eqnarray} |
| 1571 |
+ |
|
| 1572 |
+ |
The iterative schemes for both {\tt moveA} and {\tt moveB} are |
| 1573 |
+ |
identical to those described for the NPTi integrator. |
| 1574 |
+ |
|
| 1575 |
+ |
The NPTf integrator is known to conserve the following Hamiltonian: |
| 1576 |
+ |
\begin{equation} |
| 1577 |
+ |
H_{\mathrm{NPTf}} = V + K + f k_B T_{\mathrm{target}} \left( |
| 1578 |
+ |
\frac{\tau_{T}^2 \chi^2(t)}{2} + \int_{0}^{t} \chi(t^\prime) dt^\prime |
| 1579 |
+ |
\right) + P_{\mathrm{target}} \mathcal{V}(t) + \frac{f k_B |
| 1580 |
+ |
T_{\mathrm{target}}}{2} |
| 1581 |
+ |
\mathrm{Tr}\left[\overleftrightarrow{\eta}(t)\right]^2 \tau_B^2. |
| 1582 |
+ |
\end{equation} |
| 1583 |
+ |
|
| 1584 |
+ |
This integrator must be used with care, particularly in liquid |
| 1585 |
+ |
simulations. Liquids have very small restoring forces in the |
| 1586 |
+ |
off-diagonal directions, and the simulation box can very quickly form |
| 1587 |
+ |
elongated and sheared geometries which become smaller than the |
| 1588 |
+ |
electrostatic or Lennard-Jones cutoff radii. It finds most use in |
| 1589 |
+ |
simulating crystals or liquid crystals which assume non-orthorhombic |
| 1590 |
+ |
geometries. |
| 1591 |
+ |
|
| 1592 |
+ |
\subsubsection{\label{nptxyz}Constant pressure in 3 axes (NPTxyz)} |
| 1593 |
+ |
|
| 1594 |
+ |
There is one additional extended system integrator which is somewhat |
| 1595 |
+ |
simpler than the NPTf method described above. In this case, the three |
| 1596 |
+ |
axes have independent barostats which each attempt to preserve the |
| 1597 |
+ |
target pressure along the box walls perpendicular to that particular |
| 1598 |
+ |
axis. The lengths of the box axes are allowed to fluctuate |
| 1599 |
+ |
independently, but the angle between the box axes does not change. |
| 1600 |
+ |
The equations of motion are identical to those described above, but |
| 1601 |
+ |
only the {\it diagonal} elements of $\overleftrightarrow{\eta}$ are |
| 1602 |
+ |
computed. The off-diagonal elements are set to zero (even when the |
| 1603 |
+ |
pressure tensor has non-zero off-diagonal elements). |
| 1604 |
+ |
|
| 1605 |
+ |
It should be noted that the NPTxyz integrator is {\it not} known to |
| 1606 |
+ |
preserve any Hamiltonian of interest to the chemical physics |
| 1607 |
+ |
community. The integrator is extremely useful, however, in generating |
| 1608 |
+ |
initial conditions for other integration methods. It {\it is} suitable |
| 1609 |
+ |
for use with liquid simulations, or in cases where there is |
| 1610 |
+ |
orientational anisotropy in the system (i.e. in lipid bilayer |
| 1611 |
+ |
simulations). |
| 1612 |
+ |
|
| 1613 |
|
\subsection{\label{oopseSec:rattle}The {\sc rattle} Method for Bond |
| 1614 |
|
Constraints} |
| 1615 |
|
|
| 1865 |
|
If the time-dependent friction decays rapidly, the static friction |
| 1866 |
|
coefficient can be approximated by |
| 1867 |
|
\begin{equation} |
| 1868 |
< |
\xi^{static}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt |
| 1868 |
> |
\xi_{\text{static}}(z)=\int_{0}^{\infty}\langle\delta F(z,t)\delta F(z,0)\rangle dt |
| 1869 |
|
\end{equation} |
| 1870 |
< |
Therefore, the diffusion constant can then be estimated by |
| 1870 |
> |
Allowing diffusion constant to then be calculated through the |
| 1871 |
> |
Einstein relation:\cite{Marrink94} |
| 1872 |
|
\begin{equation} |
| 1873 |
< |
D(z)=\frac{k_{B}T}{\xi^{static}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty |
| 1873 |
> |
D(z)=\frac{k_{B}T}{\xi_{\text{static}}(z)}=\frac{(k_{B}T)^{2}}{\int_{0}^{\infty |
| 1874 |
|
}\langle\delta F(z,t)\delta F(z,0)\rangle dt}% |
| 1875 |
|
\end{equation} |
| 1876 |
|
|
| 1880 |
|
auto-correlation calculation.\cite{Marrink94} However, simply resetting the |
| 1881 |
|
coordinate will move the center of the mass of the whole system. To |
| 1882 |
|
avoid this problem, a new method was used in {\sc oopse}. Instead of |
| 1883 |
< |
resetting the coordinate, we reset the forces of z-constraint |
| 1883 |
> |
resetting the coordinate, we reset the forces of z-constrained |
| 1884 |
|
molecules as well as subtract the total constraint forces from the |
| 1885 |
< |
rest of the system after force calculation at each time step. |
| 1242 |
< |
\begin{align} |
| 1243 |
< |
F_{\alpha i}&=0\\ |
| 1244 |
< |
V_{\alpha i}&=V_{\alpha i}-\frac{\sum\limits_{i}M_{_{\alpha i}}V_{\alpha i}}{\sum\limits_{i}M_{_{\alpha i}}}\\ |
| 1245 |
< |
F_{\alpha i}&=F_{\alpha i}-\frac{M_{_{\alpha i}}}{\sum\limits_{\alpha}\sum\limits_{i}M_{_{\alpha i}}}\sum\limits_{\beta}F_{\beta}\\ |
| 1246 |
< |
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}}} |
| 1247 |
< |
\end{align} |
| 1885 |
> |
rest of the system after the force calculation at each time step. |
| 1886 |
|
|
| 1887 |
+ |
After the force calculation, define $G_\alpha$ as |
| 1888 |
+ |
\begin{equation} |
| 1889 |
+ |
G_{\alpha} = \sum_i F_{\alpha i} |
| 1890 |
+ |
\label{oopseEq:zc1} |
| 1891 |
+ |
\end{equation} |
| 1892 |
+ |
Where $F_{\alpha i}$ is the force in the z direction of atom $i$ in |
| 1893 |
+ |
z-constrained molecule $\alpha$. The forces of the z constrained |
| 1894 |
+ |
molecule are then set to: |
| 1895 |
+ |
\begin{equation} |
| 1896 |
+ |
F_{\alpha i} = F_{\alpha i} - |
| 1897 |
+ |
\frac{m_{\alpha i} G_{\alpha}}{\sum_i m_{\alpha i}} |
| 1898 |
+ |
\end{equation} |
| 1899 |
+ |
Here, $m_{\alpha i}$ is the mass of atom $i$ in the z-constrained |
| 1900 |
+ |
molecule. Having rescaled the forces, the velocities must also be |
| 1901 |
+ |
rescaled to subtract out any center of mass velocity in the z |
| 1902 |
+ |
direction. |
| 1903 |
+ |
\begin{equation} |
| 1904 |
+ |
v_{\alpha i} = v_{\alpha i} - |
| 1905 |
+ |
\frac{\sum_i m_{\alpha i} v_{\alpha i}}{\sum_i m_{\alpha i}} |
| 1906 |
+ |
\end{equation} |
| 1907 |
+ |
Where $v_{\alpha i}$ is the velocity of atom $i$ in the z direction. |
| 1908 |
+ |
Lastly, all of the accumulated z constrained forces must be subtracted |
| 1909 |
+ |
from the system to keep the system center of mass from drifting. |
| 1910 |
+ |
\begin{equation} |
| 1911 |
+ |
F_{\beta i} = F_{\beta i} - \frac{m_{\beta i} \sum_{\alpha} G_{\alpha}} |
| 1912 |
+ |
{\sum_{\beta}\sum_i m_{\beta i}} |
| 1913 |
+ |
\end{equation} |
| 1914 |
+ |
Where $\beta$ are all of the unconstrained molecules in the system. |
| 1915 |
+ |
|
| 1916 |
|
At the very beginning of the simulation, the molecules may not be at their |
| 1917 |
|
constrained positions. To move a z-constrained molecule to its specified |
| 1918 |
|
position, a simple harmonic potential is used |