From 509015640c6cda2ce6d0a9112838c6d85bbd7257 Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Sat, 27 Oct 2018 16:25:32 +0200 Subject: [PATCH] Add equation numbers in reference manual Went through the reference manual and added equation numbers to all equations, as Sphinx only numbers those with a label. Also performed some formatting fixes. Change-Id: If37b3a0a9b9def9b7428bdbd01c13b0b685933a1 --- .../algorithms/brownian-dynamics.rst | 10 +- .../algorithms/constraint-algorithms.rst | 49 +- .../algorithms/energy-minimization.rst | 2 + .../algorithms/expanded-ensemble.rst | 1 + .../algorithms/free-energy-calculations.rst | 36 +- .../algorithms/molecular-dynamics.rst | 513 ++++++++--------- .../algorithms/normal-mode-analysis.rst | 31 +- .../parallelization-domain-decomp.rst | 1 + .../algorithms/replica-exchange.rst | 49 +- .../algorithms/shell-molecular-dynamics.rst | 26 +- .../analysis/bond-angle-dihedral.rst | 2 +- .../analysis/correlation-function.rst | 12 +- .../analysis/covariance-analysis.rst | 71 ++- .../analysis/curve-fitting.rst | 32 +- .../analysis/dihedral-pca.rst | 15 +- .../analysis/general-properties.rst | 1 + .../analysis/mean-square-displacement.rst | 7 +- .../analysis/plots/sgangle.pdf | Bin 7199 -> 7330 bytes .../analysis/plots/sgangle.svg | 543 +++++++++--------- .../analysis/radial-distribution-function.rst | 25 +- .../analysis/using-groups.rst | 3 +- docs/reference-manual/averages.rst | 106 ++-- docs/reference-manual/definitions.rst | 24 +- docs/reference-manual/details.rst | 85 +-- .../functions/bonded-interactions.rst | 180 +++--- .../functions/free-energy-interactions.rst | 173 +++--- .../functions/interaction-methods.rst | 150 ++--- .../functions/long-range-electrostatics.rst | 23 +- .../functions/long-range-vdw.rst | 90 +-- .../functions/nonbonded-interactions.rst | 97 ++-- .../functions/polarization.rst | 16 +- .../reference-manual/functions/restraints.rst | 273 +++++---- docs/reference-manual/introduction.rst | 18 +- docs/reference-manual/special/awh.rst | 6 + .../special/comp-electrophys.rst | 2 + .../special/enforced-rotation.rst | 123 ++-- .../special/free-energy-implementation.rst | 3 + docs/reference-manual/special/pulling.rst | 21 +- docs/reference-manual/special/qmmm.rst | 4 +- .../tabulated-interaction-functions.rst | 30 +- .../special/viscosity-calculation.rst | 34 +- .../topologies/parameter-files.rst | 71 ++- 42 files changed, 1463 insertions(+), 1495 deletions(-) diff --git a/docs/reference-manual/algorithms/brownian-dynamics.rst b/docs/reference-manual/algorithms/brownian-dynamics.rst index e7d3606256..8305dac58b 100644 --- a/docs/reference-manual/algorithms/brownian-dynamics.rst +++ b/docs/reference-manual/algorithms/brownian-dynamics.rst @@ -7,6 +7,7 @@ over-damped systems, *i.e.* systems in which the inertia effects are negligible. The equation is .. math:: {{\mbox{d}}\mathbf{r}_i \over {\mbox{d}}t} = \frac{1}{\gamma_i} \mathbf{F}_i(\mathbf{r}) + {\stackrel{\circ}{\mathbf{r}}}_i + :label: eqnbrowniandyn where :math:`\gamma_i` is the friction coefficient :math:`[\mbox{amu/ps}]` and @@ -15,11 +16,10 @@ process with :math:`\langle {\stackrel{\circ}{r}}_i\!\!(t) {\stackrel{\circ}{r}}_j\!\!(t+s) \rangle = 2 \delta(s) \delta_{ij} k_B T / \gamma_i`. In |Gromacs| the equations are integrated with a simple, explicit scheme -.. math:: - - \mathbf{r}_i(t+\Delta t) = \mathbf{r}_i(t) + - {\Delta t \over \gamma_i} \mathbf{F}_i(\mathbf{r}(t)) - + \sqrt{2 k_B T {\Delta t \over \gamma_i}}\, {\mathbf{r}^G}_i, +.. math:: \mathbf{r}_i(t+\Delta t) = \mathbf{r}_i(t) + + {\Delta t \over \gamma_i} \mathbf{F}_i(\mathbf{r}(t)) + + \sqrt{2 k_B T {\Delta t \over \gamma_i}}\, {\mathbf{r}^G}_i, + :label: eqnbrowniandynint where :math:`{\mathbf{r}^G}_i` is Gaussian distributed noise with :math:`\mu = 0`, :math:`\sigma = 1`. The friction diff --git a/docs/reference-manual/algorithms/constraint-algorithms.rst b/docs/reference-manual/algorithms/constraint-algorithms.rst index 5431355c7b..baa12db831 100644 --- a/docs/reference-manual/algorithms/constraint-algorithms.rst +++ b/docs/reference-manual/algorithms/constraint-algorithms.rst @@ -13,10 +13,10 @@ SHAKE The SHAKE \ :ref:`46 ` algorithm changes a set of unconstrained coordinates :math:`\mathbf{r}^{'}` to a set of coordinates :math:`\mathbf{r}''` that fulfill a -list of distance constraints, using a set -:math:`\mathbf{r}` reference, as +list of distance constraints, using a set :math:`\mathbf{r}` reference, as .. math:: {\rm SHAKE}(\mathbf{r}^{'} \rightarrow \mathbf{r}'';\, \mathbf{r}) + :label: eqnshakebase This action is consistent with solving a set of Lagrange multipliers in the constrained equations of motion. SHAKE needs a *relative tolerance*; @@ -29,29 +29,25 @@ Assume the equations of motion must fulfill :math:`K` holonomic constraints, expressed as .. math:: \sigma_k(\mathbf{r}_1 \ldots \mathbf{r}_N) = 0; \;\; k=1 \ldots K. + :label: eqnshakemotconstr -For example, -:math:`(\mathbf{r}_1 - \mathbf{r}_2)^2 - b^2 = 0`. +For example, :math:`(\mathbf{r}_1 - \mathbf{r}_2)^2 - b^2 = 0`. Then the forces are defined as -.. math:: - - - \frac{\partial}{\partial \mathbf{r}_i} \left( V + \sum_{k=1}^K \lambda_k - \sigma_k \right), +.. math:: - \frac{\partial}{\partial \mathbf{r}_i} \left( V + \sum_{k=1}^K \lambda_k + \sigma_k \right), + :label: eqnshakeforce where :math:`\lambda_k` are Lagrange multipliers which must be solved to fulfill the constraint equations. The second part of this sum -determines the *constraint forces* :math:`\mathbf{G}_i`, -defined by - -.. math:: +determines the *constraint forces* :math:`\mathbf{G}_i`, defined by - \mathbf{G}_i = -\sum_{k=1}^K \lambda_k \frac{\partial \sigma_k}{\partial - \mathbf{r}_i} +.. math:: \mathbf{G}_i = -\sum_{k=1}^K \lambda_k \frac{\partial \sigma_k}{\partial + \mathbf{r}_i} + :label: eqnshakeconstrforces The displacement due to the constraint forces in the leap-frog or -Verlet algorithm is equal to -:math:`(\mathbf{G}_i/m_i)({{\Delta t}})^2`. Solving the +Verlet algorithm is equal to :math:`(\mathbf{G}_i/m_i)({{\Delta t}})^2`. Solving the Lagrange multipliers (and hence the displacements) requires the solution of a set of coupled equations of the second degree. These are solved iteratively by SHAKE. :ref:`settle` @@ -141,15 +137,18 @@ equation shows how the new constrained coordinates coordinates :math:`\mathbf{r}_{n+1}^{unc}` by .. math:: \begin{array}{c} - \mathbf{r}_{n+1}=(\mathbf{I}-\mathbf{T}_n \mathbf{B}_n) \mathbf{r}_{n+1}^{unc} + {\mathbf{T}}_n \mathbf{d}= - \\[2mm] - \mathbf{r}_{n+1}^{unc} - - {{\mathbf{M}}^{-1}}\mathbf{B}_n ({\mathbf{B}}_n {{\mathbf{M}}^{-1}}{\mathbf{B}}_n^T)^{-1} ({\mathbf{B}}_n \mathbf{r}_{n+1}^{unc} - \mathbf{d}) - \end{array} - :label: eqnm0 + \mathbf{r}_{n+1}=(\mathbf{I}-\mathbf{T}_n \mathbf{B}_n) \mathbf{r}_{n+1}^{unc} + {\mathbf{T}}_n \mathbf{d}= + \\[2mm] + \mathbf{r}_{n+1}^{unc} - + {{\mathbf{M}}^{-1}}\mathbf{B}_n ({\mathbf{B}}_n {{\mathbf{M}}^{-1}}{\mathbf{B}}_n^T)^{-1} ({\mathbf{B}}_n \mathbf{r}_{n+1}^{unc} - \mathbf{d}) + \end{array} + :label: eqnm0 where -:math:`{\mathbf{T}}= {{\mathbf{M}}^{-1}}{\mathbf{B}}^T ({\mathbf{B}}{{\mathbf{M}}^{-1}}{\mathbf{B}}^T)^{-1}`. + +.. math:: {\mathbf{T}}= {{\mathbf{M}}^{-1}}{\mathbf{B}}^T ({\mathbf{B}}{{\mathbf{M}}^{-1}}{\mathbf{B}}^T)^{-1} + :label: eqnnm01 + The derivation of this equation from :eq:`eqns. %s ` and :eq:`%s ` can be found in :ref:`49 `. @@ -159,13 +158,13 @@ the bonds. To correct for the rotation of bond :math:`i`, the projection of the bond, :math:`p_i`, on the old direction is set to .. math:: p_i=\sqrt{2 d_i^2 - l_i^2}, - :label: eqnm1a + :label: eqnm1a where :math:`l_i` is the bond length after the first projection. The corrected positions are .. math:: \mathbf{r}_{n+1}^*=(\mathbf{I}-\mathbf{T}_n \mathbf{B}_n)\mathbf{r}_{n+1} + {\mathbf{T}}_n \mathbf{p}. - :label: eqnm1b + :label: eqnm1b This correction for rotational effects is actually an iterative process, but during MD only one iteration is applied. The relative diff --git a/docs/reference-manual/algorithms/energy-minimization.rst b/docs/reference-manual/algorithms/energy-minimization.rst index b0024299ea..4fbb774a73 100644 --- a/docs/reference-manual/algorithms/energy-minimization.rst +++ b/docs/reference-manual/algorithms/energy-minimization.rst @@ -22,6 +22,7 @@ First the forces :math:`\mathbf{F}` and potential energy are calculated. New positions are calculated by .. math:: \mathbf{r}_{n+1} = \mathbf{r}_n + \frac{\mathbf{F}_n}{\max (|\mathbf{F}_n|)} h_n, + :label: eqnEMpos where :math:`h_n` is the maximum displacement and :math:`\mathbf{F}_n` is the force, or the negative @@ -46,6 +47,7 @@ made too tight to avoid endless iterations. A reasonable value for :math:`T`. This value is .. math:: f = 2 \pi \nu \sqrt{ 2mkT}, + :label: eqnEMharmosc where :math:`\nu` is the oscillator frequency, :math:`m` the (reduced) mass, and :math:`k` Boltzmann’s constant. For a weak oscillator with a diff --git a/docs/reference-manual/algorithms/expanded-ensemble.rst b/docs/reference-manual/algorithms/expanded-ensemble.rst index a753bf608e..4513716f81 100644 --- a/docs/reference-manual/algorithms/expanded-ensemble.rst +++ b/docs/reference-manual/algorithms/expanded-ensemble.rst @@ -7,6 +7,7 @@ variables that can be sampled over. The probability of any given state can be written as: .. math:: P(\vec{x},k) \propto \exp\left(-\beta_k U_k + g_k\right), + :label: eqnexpandensemble where :math:`\beta_k = \frac{1}{k_B T_k}` is the :math:`\beta` corresponding to the :math:`k`\ th thermodynamic state, and :math:`g_k` diff --git a/docs/reference-manual/algorithms/free-energy-calculations.rst b/docs/reference-manual/algorithms/free-energy-calculations.rst index d527c12c71..383fbef097 100644 --- a/docs/reference-manual/algorithms/free-energy-calculations.rst +++ b/docs/reference-manual/algorithms/free-energy-calculations.rst @@ -66,6 +66,7 @@ H=H(p,q;\lambda)` in such a way that :math:`\lambda=0` describes system A and :math:`\lambda=1` describes system B: .. math:: H(p,q;0)=H{^{\mathrm{A}}}(p,q);~~~~ H(p,q;1)=H{^{\mathrm{B}}}(p,q). + :label: eqnddgHamiltonian In |Gromacs|, the functional form of the :math:`\lambda`-dependence is different for the various force-field contributions and is described in @@ -79,27 +80,25 @@ related to the partition function :math:`\Delta` of an :math:`N,p,T` ensemble, which is assumed to be the equilibrium ensemble generated by a MD simulation at constant pressure and temperature: -.. math:: - - \begin{aligned} - A(\lambda) &=& -k_BT \ln Q \\ - Q &=& c \int\!\!\int \exp[-\beta H(p,q;\lambda)]\,dp\,dq \\ - G(\lambda) &=& -k_BT \ln \Delta \\ - \Delta &=& c \int\!\!\int\!\!\int \exp[-\beta H(p,q;\lambda) -\beta - pV]\,dp\,dq\,dV \\ - G &=& A + pV, \end{aligned} +.. math:: \begin{aligned} + A(\lambda) &=& -k_BT \ln Q \\ + Q &=& c \int\!\!\int \exp[-\beta H(p,q;\lambda)]\,dp\,dq \\ + G(\lambda) &=& -k_BT \ln \Delta \\ + \Delta &=& c \int\!\!\int\!\!\int \exp[-\beta H(p,q;\lambda) -\beta + pV]\,dp\,dq\,dV \\ + G &=& A + pV, \end{aligned} + :label: eqnddgGibs where :math:`\beta = 1/(k_BT)` and :math:`c = (N! h^{3N})^{-1}`. These integrals over phase space cannot be evaluated from a simulation, but it is possible to evaluate the derivative with respect to :math:`\lambda` as an ensemble average: -.. math:: - - \frac{dA}{d\lambda} = \frac{\int\!\!\int (\partial H/ \partial - \lambda) \exp[-\beta H(p,q;\lambda)]\,dp\,dq}{\int\!\!\int \exp[-\beta - H(p,q;\lambda)]\,dp\,dq} = - \left\langle \frac{\partial H}{\partial \lambda} \right\rangle_{NVT;\lambda}, +.. math:: \frac{dA}{d\lambda} = \frac{\int\!\!\int (\partial H/ \partial + \lambda) \exp[-\beta H(p,q;\lambda)]\,dp\,dq}{\int\!\!\int \exp[-\beta + H(p,q;\lambda)]\,dp\,dq} = + \left\langle \frac{\partial H}{\partial \lambda} \right\rangle_{NVT;\lambda}, + :label: eqnddgensembleave with a similar relation for :math:`dG/d\lambda` in the :math:`N,p,T` ensemble. The difference in free energy between A and B can be found by @@ -125,10 +124,9 @@ system A at pressure :math:`p` and volume :math:`V` and ending with system B at pressure :math:`p_B`, by applying the following small (but, in principle, exact) correction: -.. math:: - - G{^{\mathrm{B}}}(p)-G{^{\mathrm{A}}}(p) = - A{^{\mathrm{B}}}(V)-A{^{\mathrm{A}}}(V) - \int_p^{p{^{\mathrm{B}}}}[V{^{\mathrm{B}}}(p')-V]\,dp' +.. math:: G{^{\mathrm{B}}}(p)-G{^{\mathrm{A}}}(p) = + A{^{\mathrm{B}}}(V)-A{^{\mathrm{A}}}(V) - \int_p^{p{^{\mathrm{B}}}}[V{^{\mathrm{B}}}(p')-V]\,dp' + :label: eqnddgpresscorr Here we omitted the constant :math:`T` from the notation. This correction is roughly equal to diff --git a/docs/reference-manual/algorithms/molecular-dynamics.rst b/docs/reference-manual/algorithms/molecular-dynamics.rst index 378112531e..e881a0f2a2 100644 --- a/docs/reference-manual/algorithms/molecular-dynamics.rst +++ b/docs/reference-manual/algorithms/molecular-dynamics.rst @@ -90,6 +90,7 @@ not available, the program can generate initial atomic velocities :math:`T`: .. math:: p(v_i) = \sqrt{\frac{m_i}{2 \pi kT}}\exp\left(-\frac{m_i v_i^2}{2kT}\right) + :label: eqnmaxwellboltzman where :math:`k` is Boltzmann’s constant (see chapter :ref:`defunits`). To accomplish this, normally distributed random numbers are generated by @@ -273,70 +274,67 @@ surrounded by all :math:`j` particles that are of type 2 with number density :math:`\rho_2`, when the inter-particle distance changes from :math:`r_0` to :math:`r_t`, as: -.. math:: - - \langle \Delta V \rangle = - \int_{0}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 V(r_t) G\!\left(\frac{r_t-r_0}{\sigma}\right) d r_0\, d r_t +.. math:: \langle \Delta V \rangle = + \int_{0}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 V(r_t) G\!\left(\frac{r_t-r_0}{\sigma}\right) d r_0\, d r_t + :label: eqnverletbufenergy To evaluate this analytically, we need to make some approximations. First we replace :math:`V(r_t)` by a Taylor expansion around :math:`r_c`, then we can move the lower bound of the integral over :math:`r_0` to :math:`-\infty` which will simplify the result: -.. math:: - - \begin{aligned} - \langle \Delta V \rangle &\approx& - \int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[ V'(r_c) (r_t - r_c) + - \nonumber\\ - & & - \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} - V''(r_c)\frac{1}{2}(r_t - r_c)^2 + - \nonumber\\ - & & - \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} - V'''(r_c)\frac{1}{6}(r_t - r_c)^3 + - \nonumber\\ - & & - \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} - O \! \left((r_t - r_c)^4 \right)\Big] G\!\left(\frac{r_t-r_0}{\sigma}\right) d r_0 \, d r_t\end{aligned} +.. math:: \begin{aligned} + \langle \Delta V \rangle &\approx& + \int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[ V'(r_c) (r_t - r_c) + + \nonumber\\ + & & + \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} + V''(r_c)\frac{1}{2}(r_t - r_c)^2 + + \nonumber\\ + & & + \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} + V'''(r_c)\frac{1}{6}(r_t - r_c)^3 + + \nonumber\\ + & & + \phantom{\int_{-\infty}^{r_c} \int_{r_\ell}^\infty 4 \pi r_0^2 \rho_2 \Big[} + O \! \left((r_t - r_c)^4 \right)\Big] G\!\left(\frac{r_t-r_0}{\sigma}\right) d r_0 \, d r_t\end{aligned} + :label: eqnverletaylor Replacing the factor :math:`r_0^2` by :math:`(r_\ell + \sigma)^2`, which results in a slight overestimate, allows us to calculate the integrals analytically: -.. math:: - - \begin{aligned} - \langle \Delta V \rangle \! - &\approx& - 4 \pi (r_\ell+\sigma)^2 \rho_2 - \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[ V'(r_c) (r_t - r_c) + - \nonumber\\ - & & - \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[} - V''(r_c)\frac{1}{2}(r_t - r_c)^2 + - \nonumber\\ - & & - \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[} - V'''(r_c)\frac{1}{6}(r_t - r_c)^3 \Big] G\!\left(\frac{r_t-r_0}{\sigma}\right) - d r_0 \, d r_t\\ - &=& - 4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ - \frac{1}{2}V'(r_c)\left[r_b \sigma G\!\left(\frac{r_b}{\sigma}\right) - (r_b^2+\sigma^2)E\!\left(\frac{r_b}{\sigma}\right) \right] + - \nonumber\\ - & & - \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ } - \frac{1}{6}V''(r_c)\left[ \sigma(r_b^2+2\sigma^2) G\!\left(\frac{r_b}{\sigma}\right) - r_b(r_b^2+3\sigma^2 ) E\!\left(\frac{r_b}{\sigma}\right) \right] + - \nonumber\\ - & & - \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ } - \frac{1}{24}V'''(r_c)\bigg[ r_b\sigma(r_b^2+5\sigma^2) G\!\left(\frac{r_b}{\sigma}\right) - \nonumber\\ - & & - \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ \frac{1}{24}V'''(r_c)\bigg[ } - - (r_b^4+6r_b^2\sigma^2+3\sigma^4 ) E\!\left(\frac{r_b}{\sigma}\right) \bigg] - \bigg\}\end{aligned} +.. math:: \begin{aligned} + \langle \Delta V \rangle \! + &\approx& + 4 \pi (r_\ell+\sigma)^2 \rho_2 + \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[ V'(r_c) (r_t - r_c) + + \nonumber\\ + & & + \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[} + V''(r_c)\frac{1}{2}(r_t - r_c)^2 + + \nonumber\\ + & & + \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \int_{-\infty}^{r_c} \int_{r_\ell}^\infty \Big[} + V'''(r_c)\frac{1}{6}(r_t - r_c)^3 \Big] G\!\left(\frac{r_t-r_0}{\sigma}\right) + d r_0 \, d r_t\\ + &=& + 4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ + \frac{1}{2}V'(r_c)\left[r_b \sigma G\!\left(\frac{r_b}{\sigma}\right) - (r_b^2+\sigma^2)E\!\left(\frac{r_b}{\sigma}\right) \right] + + \nonumber\\ + & & + \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ } + \frac{1}{6}V''(r_c)\left[ \sigma(r_b^2+2\sigma^2) G\!\left(\frac{r_b}{\sigma}\right) - r_b(r_b^2+3\sigma^2 ) E\!\left(\frac{r_b}{\sigma}\right) \right] + + \nonumber\\ + & & + \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ } + \frac{1}{24}V'''(r_c)\bigg[ r_b\sigma(r_b^2+5\sigma^2) G\!\left(\frac{r_b}{\sigma}\right) + \nonumber\\ + & & + \phantom{4 \pi (r_\ell+\sigma)^2 \rho_2 \bigg\{ \frac{1}{24}V'''(r_c)\bigg[ } + - (r_b^4+6r_b^2\sigma^2+3\sigma^4 ) E\!\left(\frac{r_b}{\sigma}\right) \bigg] + \bigg\}\end{aligned} + :label: eqnverletanalytical where :math:`G(x)` is a Gaussian distribution with 0 mean and unit variance and :math:`E(x)=\frac{1}{2}\mathrm{erfc}(x/\sqrt{2})`. We @@ -452,14 +450,13 @@ Due to :eq:`eqns. %s ` and :math:`{\mathbf{r}_{ij}}` connecting images within the cut-off :math:`R_c` can be found by constructing: -.. math:: - - \begin{aligned} - \mathbf{r}''' & = & \mathbf{r}_j-\mathbf{r}_i \\ - \mathbf{r}'' & = & \mathbf{r}''' - \mathbf{c}*\mathrm{round}(r'''_z/c_z) \\ - \mathbf{r}' & = & \mathbf{r}'' - \mathbf{b}*\mathrm{round}(r''_y/b_y) \\ - \mathbf{r}_{ij} & = & \mathbf{r}' - \mathbf{a}*\mathrm{round}(r'_x/a_x) - \end{aligned} +.. math:: \begin{aligned} + \mathbf{r}''' & = & \mathbf{r}_j-\mathbf{r}_i \\ + \mathbf{r}'' & = & \mathbf{r}''' - \mathbf{c}*\mathrm{round}(r'''_z/c_z) \\ + \mathbf{r}' & = & \mathbf{r}'' - \mathbf{b}*\mathrm{round}(r''_y/b_y) \\ + \mathbf{r}_{ij} & = & \mathbf{r}' - \mathbf{a}*\mathrm{round}(r'_x/a_x) + \end{aligned} + :label: eqnsearchvec When distances between two particles in a triclinic box are needed that do not obey :eq:`eqn. %s `, many shifts of @@ -558,6 +555,7 @@ The temperature is given by the total kinetic energy of the :math:`N`-particle system: .. math:: E_{kin} = {\frac{1}{2}}\sum_{i=1}^N m_i v_i^2 + :label: eqntempEkin From this the absolute temperature :math:`T` can be computed using: @@ -568,6 +566,7 @@ where :math:`k` is Boltzmann’s constant and :math:`N_{df}` is the number of degrees of freedom which can be computed from: .. math:: N_{\mathrm{df}} ~=~ 3 N - N_c - N_{\mathrm{com}} + :label: eqndofcoupling Here :math:`N_c` is the number of *constraints* imposed on the system. When performing molecular dynamics :math:`N_{\mathrm{com}}=3` additional @@ -579,12 +578,14 @@ one temperature-coupling group is used, the number of degrees of freedom for group :math:`i` is: .. math:: N^i_{\mathrm{df}} ~=~ (3 N^i - N^i_c) \frac{3 N - N_c - N_{\mathrm{com}}}{3 N - N_c} + :label: eqndofonecouplgroup The kinetic energy can also be written as a tensor, which is necessary for pressure calculation in a triclinic system, or systems where shear forces are imposed: .. math:: {\bf E}_{\mathrm{kin}} = {\frac{1}{2}}\sum_i^N m_i {\mathbf{v}_i}\otimes {\mathbf{v}_i} + :label: eqnEkintensor Pressure and virial ^^^^^^^^^^^^^^^^^^^ @@ -647,6 +648,7 @@ produces trajectories that are identical to the Verlet \ :ref:`23 algorithm, whose position-update relation is .. math:: \mathbf{r}(t+{{\Delta t}})~=~2\mathbf{r}(t) - \mathbf{r}(t-{{\Delta t}}) + \frac{1}{m}\mathbf{F}(t){{\Delta t}}^2+O({{\Delta t}}^4) + :label: eqnleapfrogp The algorithm is of third order in :math:`\mathbf{r}` and is time-reversible. See ref. \ :ref:`24 ` for the @@ -705,11 +707,10 @@ A system of coupled, first-order differential equations can be evolved from time :math:`t = 0` to time :math:`t` by applying the evolution operator -.. math:: - - \begin{aligned} - \Gamma(t) &=& \exp(iLt) \Gamma(0) \nonumber \\ - iL &=& \dot{\Gamma}\cdot \nabla_{\Gamma},\end{aligned} +.. math:: \begin{aligned} + \Gamma(t) &=& \exp(iLt) \Gamma(0) \nonumber \\ + iL &=& \dot{\Gamma}\cdot \nabla_{\Gamma},\end{aligned} + :label: eqnevoluoperator where :math:`L` is the Liouville operator, and :math:`\Gamma` is the multidimensional vector of independent variables (positions and @@ -718,21 +719,20 @@ at time :math:`{{\Delta t}}= t/P`, is applied :math:`P` times in succession to evolve the system as .. math:: \Gamma(t) = \prod_{i=1}^P \exp(iL{{\Delta t}}) \Gamma(0) + :label: eqnevolvesystem For NVE dynamics, the Liouville operator is -.. math:: - - \begin{aligned} - iL = \sum_{i=1}^{N} {{\mathbf{v}}}_i \cdot \nabla_{{{\mathbf{r}}}_i} + \sum_{i=1}^N \frac{1}{m_i}{{\mathbf{F}}}(r_i) \cdot \nabla_{{{\mathbf{v}}}_i}.\end{aligned} +.. math:: \begin{aligned} + iL = \sum_{i=1}^{N} {{\mathbf{v}}}_i \cdot \nabla_{{{\mathbf{r}}}_i} + \sum_{i=1}^N \frac{1}{m_i}{{\mathbf{F}}}(r_i) \cdot \nabla_{{{\mathbf{v}}}_i}.\end{aligned} + :label: eqnliouvilleoperator This can be split into two additive operators -.. math:: - - \begin{aligned} - iL_1 &=& \sum_{i=1}^N \frac{1}{m_i}{{\mathbf{F}}}(r_i) \cdot \nabla_{{{\mathbf{v}}}_i} \nonumber \\ - iL_2 &=& \sum_{i=1}^{N} {{\mathbf{v}}}_i \cdot \nabla_{{{\mathbf{r}}}_i} \end{aligned} +.. math:: \begin{aligned} + iL_1 &=& \sum_{i=1}^N \frac{1}{m_i}{{\mathbf{F}}}(r_i) \cdot \nabla_{{{\mathbf{v}}}_i} \nonumber \\ + iL_2 &=& \sum_{i=1}^{N} {{\mathbf{v}}}_i \cdot \nabla_{{{\mathbf{r}}}_i} \end{aligned} + :label: eqnlotwoadditive Then a short-time, symmetric, and thus reversible approximation of the true dynamics will be @@ -749,12 +749,11 @@ corresponds to a full velocity step, and the last exponential term over :math:`{{\frac{1}{2}}{{\Delta t}}}` is the final velocity half step. For future times :math:`t = n{{\Delta t}}`, this becomes -.. math:: - - \begin{aligned} - \exp(iLn{{\Delta t}}) &\approx& \left(\exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \exp(iL_1{{\Delta t}}) \exp(iL_2{{\frac{1}{2}}{{\Delta t}}})\right)^n \nonumber \\ - &\approx& \exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \bigg(\exp(iL_1{{\Delta t}}) \exp(iL_2{{\Delta t}})\bigg)^{n-1} \nonumber \\ - & & \;\;\;\; \exp(iL_1{{\Delta t}}) \exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \end{aligned} +.. math:: \begin{aligned} + \exp(iLn{{\Delta t}}) &\approx& \left(\exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \exp(iL_1{{\Delta t}}) \exp(iL_2{{\frac{1}{2}}{{\Delta t}}})\right)^n \nonumber \\ + &\approx& \exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \bigg(\exp(iL_1{{\Delta t}}) \exp(iL_2{{\Delta t}})\bigg)^{n-1} \nonumber \\ + & & \;\;\;\; \exp(iL_1{{\Delta t}}) \exp(iL_2{{\frac{1}{2}}{{\Delta t}}}) \end{aligned} + :label: eqntrottertimestep This formalism allows us to easily see the difference between the different flavors of Verlet integrators. The leap-frog integrator can be @@ -762,10 +761,9 @@ seen as starting with :eq:`Eq. %s ` with the :math:`\exp\left(iL_1 {\Delta t}\right)` term, instead of the half-step velocity term, yielding -.. math:: - - \begin{aligned} - \exp(iLn{\Delta t}) &=& \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {{\Delta t}}\right) + \mathcal{O}({{\Delta t}}^3).\end{aligned} +.. math:: \begin{aligned} + \exp(iLn{\Delta t}) &=& \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {{\Delta t}}\right) + \mathcal{O}({{\Delta t}}^3).\end{aligned} + :label: eqnleapfroghalfvel Here, the full step in velocity is between :math:`t-{{\frac{1}{2}}{{\Delta t}}}` and @@ -773,10 +771,9 @@ Here, the full step in velocity is between velocity half steps in velocity Verlet. For future times :math:`t = n{{\Delta t}}`, this becomes -.. math:: - - \begin{aligned} - \exp(iLn{\Delta t}) &\approx& \bigg(\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {{\Delta t}}\right) \bigg)^{n}.\end{aligned} +.. math:: \begin{aligned} + \exp(iLn{\Delta t}) &\approx& \bigg(\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {{\Delta t}}\right) \bigg)^{n}.\end{aligned} + :label: eqnvelverlethalfvel Although at first this does not appear symmetric, as long as the full velocity step is between :math:`t-{{\frac{1}{2}}{{\Delta t}}}` and @@ -790,21 +787,19 @@ uses the velocities at the :math:`t` to calculate the kinetic energy and thus the temperature only at time :math:`t`; the kinetic energy is then a sum over all particles -.. math:: - - \begin{aligned} - KE_{\mathrm{full}}(t) &=& \sum_i \left(\frac{1}{2m_i}\mathbf{v}_i(t)\right)^2 \nonumber\\ - &=& \sum_i \frac{1}{2m_i}\left(\frac{1}{2}\mathbf{v}_i(t-{{\frac{1}{2}}{{\Delta t}}})+\frac{1}{2}\mathbf{v}_i(t+{{\frac{1}{2}}{{\Delta t}}})\right)^2,\end{aligned} +.. math:: \begin{aligned} + KE_{\mathrm{full}}(t) &=& \sum_i \left(\frac{1}{2m_i}\mathbf{v}_i(t)\right)^2 \nonumber\\ + &=& \sum_i \frac{1}{2m_i}\left(\frac{1}{2}\mathbf{v}_i(t-{{\frac{1}{2}}{{\Delta t}}})+\frac{1}{2}\mathbf{v}_i(t+{{\frac{1}{2}}{{\Delta t}}})\right)^2,\end{aligned} + :label: eqnTrotterEkin with the square on the *outside* of the average. Standard leap-frog calculates the kinetic energy at time :math:`t` based on the average kinetic energies at the timesteps :math:`t+{{\frac{1}{2}}{{\Delta t}}}` and :math:`t-{{\frac{1}{2}}{{\Delta t}}}`, or the sum over all particles -.. math:: - - \begin{aligned} - KE_{\mathrm{average}}(t) &=& \sum_i \frac{1}{2m_i}\left(\frac{1}{2}\mathbf{v}_i(t-{{\frac{1}{2}}{{\Delta t}}})^2+\frac{1}{2}\mathbf{v}_i(t+{{\frac{1}{2}}{{\Delta t}}})^2\right),\end{aligned} +.. math:: \begin{aligned} + KE_{\mathrm{average}}(t) &=& \sum_i \frac{1}{2m_i}\left(\frac{1}{2}\mathbf{v}_i(t-{{\frac{1}{2}}{{\Delta t}}})^2+\frac{1}{2}\mathbf{v}_i(t+{{\frac{1}{2}}{{\Delta t}}})^2\right),\end{aligned} + :label: eqnTrottersumparticles where the square is *inside* the average. @@ -960,6 +955,7 @@ time constant :math:`\tau` of the temperature coupling (:eq:`eqn. %s `): .. math:: \tau = 2 C_V \tau_T / N_{df} k + :label: eqnTcoupltau where :math:`C_V` is the total heat capacity of the system, :math:`k` is Boltzmann’s constant, and :math:`N_{df}` is the total number of @@ -978,6 +974,7 @@ much closer to 1.0. The thermostat modifies the kinetic energy at each scaling step by: .. math:: \Delta E_k = (\lambda - 1)^2 E_k + :label: eqnThermostat The sum of these changes over the run needs to subtracted from the total energy to obtain the conserved energy quantity. @@ -1060,6 +1057,7 @@ the global :ref:`MD scheme ` are replaced by: where the equation of motion for the heat bath parameter :math:`\xi` is: .. math:: \frac {{\mbox{d}}p_{\xi}}{{\mbox{d}}t} = \left( T - T_0 \right). + :label: eqnNHheatbath The reference temperature is denoted :math:`T_0`, while :math:`T` is the current instantaneous temperature of the system. The strength of the @@ -1070,10 +1068,9 @@ temperature.  [1]_ The conserved quantity for the Nosé-Hoover equations of motion is not the total energy, but rather -.. math:: - - \begin{aligned} - H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) +\frac{p_{\xi}^2}{2Q} + N_fkT\xi,\end{aligned} +.. math:: \begin{aligned} + H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) +\frac{p_{\xi}^2}{2Q} + N_fkT\xi,\end{aligned} + :label: eqnNHconservedbasic where :math:`N_f` is the total number of degrees of freedom. @@ -1089,6 +1086,7 @@ and the reservoir instead. It is directly related to :math:`Q` and :math:`T_0` via: .. math:: Q = \frac {\tau_T^2 T_0}{4 \pi^2}. + :label: eqnNHQ This provides a much more intuitive way of selecting the Nosé-Hoover coupling strength (similar to the weak-coupling relaxation), and in @@ -1130,10 +1128,9 @@ particles \ :ref:`34 `: The conserved quantity for Nosé-Hoover chains is -.. math:: - - \begin{aligned} - H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) +\sum_{k=1}^M\frac{p^2_{\xi_k}}{2Q^{\prime}_k} + N_fkT\xi_1 + kT\sum_{k=2}^M \xi_k \end{aligned} +.. math:: \begin{aligned} + H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) +\sum_{k=1}^M\frac{p^2_{\xi_k}}{2Q^{\prime}_k} + N_fkT\xi_1 + kT\sum_{k=2}^M \xi_k \end{aligned} + :label: eqnNHconservedquantity The values and velocities of the Nosé-Hoover thermostat variables are generally not included in the output, as they take up a fair amount of @@ -1157,24 +1154,23 @@ with more details in Ref. \ :ref:`35 `), we split the Liouville operator as .. math:: iL = iL_1 + iL_2 + iL_{\mathrm{NHC}}, + :label: eqnNHTrotter where -.. math:: - - \begin{aligned} - iL_1 &=& \sum_{i=1}^N \left[\frac{{{\mathbf{p}}}_i}{m_i}\right]\cdot \frac{\partial}{\partial {{\mathbf{r}}}_i} \nonumber \\ - iL_2 &=& \sum_{i=1}^N {{\mathbf{F}}}_i\cdot \frac{\partial}{\partial {{\mathbf{p}}}_i} \nonumber \\ - iL_{\mathrm{NHC}} &=& \sum_{i=1}^N-\frac{p_{\xi}}{Q}{{\mathbf{v}}}_i\cdot \nabla_{{{\mathbf{v}}}_i} +\frac{p_{\xi}}{Q}\frac{\partial }{\partial \xi} + \left( T - T_0 \right)\frac{\partial }{\partial p_{\xi}}\end{aligned} +.. math:: \begin{aligned} + iL_1 &=& \sum_{i=1}^N \left[\frac{{{\mathbf{p}}}_i}{m_i}\right]\cdot \frac{\partial}{\partial {{\mathbf{r}}}_i} \nonumber \\ + iL_2 &=& \sum_{i=1}^N {{\mathbf{F}}}_i\cdot \frac{\partial}{\partial {{\mathbf{p}}}_i} \nonumber \\ + iL_{\mathrm{NHC}} &=& \sum_{i=1}^N-\frac{p_{\xi}}{Q}{{\mathbf{v}}}_i\cdot \nabla_{{{\mathbf{v}}}_i} +\frac{p_{\xi}}{Q}\frac{\partial }{\partial \xi} + \left( T - T_0 \right)\frac{\partial }{\partial p_{\xi}}\end{aligned} + :label: eqnNHTrotter2 For standard velocity Verlet with Nosé-Hoover temperature control, this becomes -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ - &&\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) + \mathcal{O}({{\Delta t}}^3).\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ + &&\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) + \mathcal{O}({{\Delta t}}^3).\end{aligned} + :label: eqnNHTrotter3 For half-step-averaged temperature control using *md-vv-avek*, this decomposition will not work, since we do not have the full step @@ -1195,11 +1191,10 @@ integrator can be seen as starting with :eq:`Eq. %s ` just before the :math:`\exp\left(iL_1 {\Delta t}\right)` term, yielding: -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &=& \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \\ - &&\exp\left(iL_2 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) + \mathcal{O}({{\Delta t}}^3)\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &=& \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \\ + &&\exp\left(iL_2 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) + \mathcal{O}({{\Delta t}}^3)\end{aligned} + :label: eqnNHleapfrog and then using some algebra tricks to solve for some quantities are required before they are actually calculated \ :ref:`36 `. @@ -1260,12 +1255,13 @@ which has the effect of a first-order kinetic relaxation of the pressure towards a given reference pressure :math:`{\bf P}_0` according to .. math:: \frac{{\mbox{d}}{\bf P}}{{\mbox{d}}t} = \frac{{\bf P}_0-{\bf P}}{\tau_p}. + :label: eqnberendsenpressure The scaling matrix :math:`\mu` is given by .. math:: \mu_{ij} - = \delta_{ij} - \frac{n_\mathrm{PC}\Delta t}{3\, \tau_p} \beta_{ij} \{P_{0ij} - P_{ij}(t) \}. - :label: eqnmu + = \delta_{ij} - \frac{n_\mathrm{PC}\Delta t}{3\, \tau_p} \beta_{ij} \{P_{0ij} - P_{ij}(t) \}. + :label: eqnmu Here, :math:`\beta` is the isothermal compressibility of the system. In most cases this will be a diagonal matrix, with equal elements on the @@ -1282,14 +1278,13 @@ anisotropically, the system has to be rotated in order to obey scaling, which is usually less than :math:`10^{-4}`. The actual scaling matrix :math:`\mu'` is -.. math:: - - \mathbf{\mu'} = - \left(\begin{array}{ccc} - \mu_{xx} & \mu_{xy} + \mu_{yx} & \mu_{xz} + \mu_{zx} \\ - 0 & \mu_{yy} & \mu_{yz} + \mu_{zy} \\ - 0 & 0 & \mu_{zz} - \end{array}\right). +.. math:: \mathbf{\mu'} = + \left(\begin{array}{ccc} + \mu_{xx} & \mu_{xy} + \mu_{yx} & \mu_{xz} + \mu_{zx} \\ + 0 & \mu_{yy} & \mu_{yz} + \mu_{zy} \\ + 0 & 0 & \mu_{zz} + \end{array}\right). + :label: eqnberendsenpressurescaling The velocities are neither scaled nor rotated. Since the equations of motion are modified by pressure coupling, the conserved energy quantity @@ -1297,10 +1292,9 @@ also needs to be modified. For first order pressure coupling, the work the barostat applies to the system every step needs to be subtracted from the total energy to obtain the conserved energy quantity: -.. math:: - - - \sum_{i,j} (\mu_{ij} -\delta_{ij}) P_{ij} V = - \sum_{i,j} 2(\mu_{ij} -\delta_{ij}) \Xi_{ij} +.. math:: - \sum_{i,j} (\mu_{ij} -\delta_{ij}) P_{ij} V = + \sum_{i,j} 2(\mu_{ij} -\delta_{ij}) \Xi_{ij} + :label: eqnberendsenpressureconserved where :math:`\delta_{ij}` is the Kronecker delta and :math:`{\bf \Xi}` is the virial. Note that the factor 2 originates from the factor @@ -1340,6 +1334,7 @@ Parrinello-Rahman barostat, the box vectors as represented by the matrix obey the matrix equation of motion [2]_ .. math:: \frac{{\mbox{d}}\mathbf{b}^2}{{\mbox{d}}t^2}= V \mathbf{W}^{-1} \mathbf{b}'^{-1} \left( \mathbf{P} - \mathbf{P}_{ref}\right). + :label: eqnPRpressure The volume of the box is denoted :math:`V`, and :math:`\mathbf{W}` is a matrix parameter that determines @@ -1352,22 +1347,20 @@ Parrinello-Rahman barostat with the Nosé-Hoover thermostat, but to keep it simple we only show the Parrinello-Rahman modification here. The modified Hamiltonian, which will be conserved, is: -.. math:: - - E_\mathrm{pot} + E_\mathrm{kin} + \sum_i P_{ii} V + - \sum_{i,j} \frac{1}{2} W_{ij} \left( \frac{{\mbox{d}}b_{ij}}{{\mbox{d}}t} \right)^2 +.. math:: E_\mathrm{pot} + E_\mathrm{kin} + \sum_i P_{ii} V + + \sum_{i,j} \frac{1}{2} W_{ij} \left( \frac{{\mbox{d}}b_{ij}}{{\mbox{d}}t} \right)^2 + :label: eqnPRpressureconserved The equations of motion for the atoms, obtained from the Hamiltonian are: -.. math:: - - \begin{aligned} - \frac {{\mbox{d}}^2\mathbf{r}_i}{{\mbox{d}}t^2} & = & \frac{\mathbf{F}_i}{m_i} - - \mathbf{M} \frac{{\mbox{d}}\mathbf{r}_i}{{\mbox{d}}t} , \\ \mathbf{M} & = & \mathbf{b}^{-1} \left[ - \mathbf{b} \frac{{\mbox{d}}\mathbf{b}'}{{\mbox{d}}t} + \frac{{\mbox{d}}\mathbf{b}}{{\mbox{d}}t} \mathbf{b}' - \right] \mathbf{b}'^{-1}. - \end{aligned} +.. math:: \begin{aligned} + \frac {{\mbox{d}}^2\mathbf{r}_i}{{\mbox{d}}t^2} & = & \frac{\mathbf{F}_i}{m_i} - + \mathbf{M} \frac{{\mbox{d}}\mathbf{r}_i}{{\mbox{d}}t} , \\ \mathbf{M} & = & \mathbf{b}^{-1} \left[ + \mathbf{b} \frac{{\mbox{d}}\mathbf{b}'}{{\mbox{d}}t} + \frac{{\mbox{d}}\mathbf{b}}{{\mbox{d}}t} \mathbf{b}' + \right] \mathbf{b}'^{-1}. + \end{aligned} + :label: eqnPRpressuremotion This extra term has the appearance of a friction, but it should be noted that it is ficticious, and rather an effect of the @@ -1394,10 +1387,9 @@ approximate isothermal compressibilities :math:`\beta` and the pressure time constant :math:`\tau_p` in the input file (:math:`L` is the largest box matrix element): -.. math:: - - \left( - \mathbf{W}^{-1} \right)_{ij} = \frac{4 \pi^2 \beta_{ij}}{3 \tau_p^2 L}. +.. math:: \left( + \mathbf{W}^{-1} \right)_{ij} = \frac{4 \pi^2 \beta_{ij}}{3 \tau_p^2 L}. + :label: eqnPRpressuretimeconst Just as for the Nosé-Hoover thermostat, you should realize that the Parrinello-Rahman time constant is *not* equivalent to the relaxation @@ -1426,22 +1418,23 @@ algorithm in |Gromacs|. The average surface tension :math:`\gamma(t)` can be calculated from the difference between the normal and the lateral pressure -.. math:: - - \begin{aligned} - \gamma(t) & = & - \frac{1}{n} \int_0^{L_z} - \left\{ P_{zz}(z,t) - \frac{P_{xx}(z,t) + P_{yy}(z,t)}{2} \right\} \mbox{d}z \\ - & = & - \frac{L_z}{n} \left\{ P_{zz}(t) - \frac{P_{xx}(t) + P_{yy}(t)}{2} \right\},\end{aligned} +.. math:: \begin{aligned} + \gamma(t) & = & + \frac{1}{n} \int_0^{L_z} + \left\{ P_{zz}(z,t) - \frac{P_{xx}(z,t) + P_{yy}(z,t)}{2} \right\} \mbox{d}z \\ + & = & + \frac{L_z}{n} \left\{ P_{zz}(t) - \frac{P_{xx}(t) + P_{yy}(t)}{2} \right\},\end{aligned} + :label: eqnsurftenscoupl where :math:`L_z` is the height of the box and :math:`n` is the number of surfaces. The pressure in the z-direction is corrected by scaling the height of the box with :math:`\mu_{zz}` .. math:: \Delta P_{zz} = \frac{\Delta t}{\tau_p} \{ P_{0zz} - P_{zz}(t) \} + :label: eqnzpressure .. math:: \mu_{zz} = 1 + \beta_{zz} \Delta P_{zz} + :label: eqnzpressure2 This is similar to normal pressure coupling, except that the factor of :math:`1/3` is missing. The pressure correction in the @@ -1449,12 +1442,11 @@ This is similar to normal pressure coupling, except that the factor of surface tension to the reference value :math:`\gamma_0`. The correction factor for the box length in the :math:`x`/:math:`y`-direction is -.. math:: - - \mu_{x/y} = 1 + \frac{\Delta t}{2\,\tau_p} \beta_{x/y} - \left( \frac{n \gamma_0}{\mu_{zz} L_z} - - \left\{ P_{zz}(t)+\Delta P_{zz} - \frac{P_{xx}(t) + P_{yy}(t)}{2} \right\} - \right) +.. math:: \mu_{x/y} = 1 + \frac{\Delta t}{2\,\tau_p} \beta_{x/y} + \left( \frac{n \gamma_0}{\mu_{zz} L_z} + - \left\{ P_{zz}(t)+\Delta P_{zz} - \frac{P_{xx}(t) + P_{yy}(t)}{2} \right\} + \right) + :label: eqnboxlengthcorr The value of :math:`\beta_{zz}` is more critical than with normal pressure coupling. Normally an incorrect compressibility will just scale @@ -1486,123 +1478,111 @@ volume. The momentum of :math:`\epsilon` is The isobaric equations are -.. math:: - - \begin{aligned} - \dot{{{\mathbf{r}}}}_i &=& \frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W} {{\mathbf{r}}}_i \nonumber \\ - \frac{\dot{{{\mathbf{p}}}}_i}{m_i} &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha\frac{{p_{\epsilon}}}{W} \frac{{{\mathbf{p}}}_i}{m_i} \nonumber \\ - \dot{\epsilon} &=& \frac{{p_{\epsilon}}}{W} \nonumber \\ - \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}(P_{\mathrm{int}} - P) + (\alpha-1)\left(\sum_{n=1}^N\frac{{{\mathbf{p}}}_i^2}{m_i}\right),\\\end{aligned} +.. math:: \begin{aligned} + \dot{{{\mathbf{r}}}}_i &=& \frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W} {{\mathbf{r}}}_i \nonumber \\ + \frac{\dot{{{\mathbf{p}}}}_i}{m_i} &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha\frac{{p_{\epsilon}}}{W} \frac{{{\mathbf{p}}}_i}{m_i} \nonumber \\ + \dot{\epsilon} &=& \frac{{p_{\epsilon}}}{W} \nonumber \\ + \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}(P_{\mathrm{int}} - P) + (\alpha-1)\left(\sum_{n=1}^N\frac{{{\mathbf{p}}}_i^2}{m_i}\right),\\\end{aligned} + :label: eqnMTTKisobaric where -.. math:: - - \begin{aligned} - P_{\mathrm{int}} &=& P_{\mathrm{kin}} -P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{{{\mathbf{p}}}_i^2}{2m_i} - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\ - \right)\right].\end{aligned} +.. math:: \begin{aligned} + P_{\mathrm{int}} &=& P_{\mathrm{kin}} -P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{{{\mathbf{p}}}_i^2}{2m_i} - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\ + \right)\right].\end{aligned} + :label: eqnMTTKisobaric2 The terms including :math:`\alpha` are required to make phase space incompressible \ :ref:`41 `. The :math:`\epsilon` acceleration term can be rewritten as -.. math:: - - \begin{aligned} - \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}\left(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P\right)\end{aligned} +.. math:: \begin{aligned} + \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}\left(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P\right)\end{aligned} + :label: eqnMTTKaccel In terms of velocities, these equations become -.. math:: - - \begin{aligned} - \dot{{{\mathbf{r}}}}_i &=& {{\mathbf{v}}}_i + {v_{\epsilon}}{{\mathbf{r}}}_i \nonumber \\ - \dot{{{\mathbf{v}}}}_i &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha{v_{\epsilon}}{{\mathbf{v}}}_i \nonumber \\ - \dot{\epsilon} &=& {v_{\epsilon}}\nonumber \\ - \dot{{v_{\epsilon}}} &=& \frac{3V}{W}(P_{\mathrm{int}} - P) + (\alpha-1)\left( \sum_{n=1}^N \frac{1}{2} m_i {{\mathbf{v}}}_i^2\right)\nonumber \\ - P_{\mathrm{int}} &=& P_{\mathrm{kin}} - P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{1}{2} m_i{{\mathbf{v}}}_i^2 - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\right)\right]\end{aligned} +.. math:: \begin{aligned} + \dot{{{\mathbf{r}}}}_i &=& {{\mathbf{v}}}_i + {v_{\epsilon}}{{\mathbf{r}}}_i \nonumber \\ + \dot{{{\mathbf{v}}}}_i &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha{v_{\epsilon}}{{\mathbf{v}}}_i \nonumber \\ + \dot{\epsilon} &=& {v_{\epsilon}}\nonumber \\ + \dot{{v_{\epsilon}}} &=& \frac{3V}{W}(P_{\mathrm{int}} - P) + (\alpha-1)\left( \sum_{n=1}^N \frac{1}{2} m_i {{\mathbf{v}}}_i^2\right)\nonumber \\ + P_{\mathrm{int}} &=& P_{\mathrm{kin}} - P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{1}{2} m_i{{\mathbf{v}}}_i^2 - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\right)\right]\end{aligned} + :label: eqnMTTKvel For these equations, the conserved quantity is -.. math:: - - \begin{aligned} - H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i^2}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) + \frac{p_\epsilon}{2W} + PV\end{aligned} +.. math:: \begin{aligned} + H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i^2}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) + \frac{p_\epsilon}{2W} + PV\end{aligned} + :label: eqnMTTKconserved The next step is to add temperature control. Adding Nosé-Hoover chains, including to the barostat degree of freedom, where we use :math:`\eta` for the barostat Nosé-Hoover variables, and :math:`Q^{\prime}` for the coupling constants of the thermostats of the barostats, we get -.. math:: - - \begin{aligned} - \dot{{{\mathbf{r}}}}_i &=& \frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W} {{\mathbf{r}}}_i \nonumber \\ - \frac{\dot{{{\mathbf{p}}}}_i}{m_i} &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha\frac{{p_{\epsilon}}}{W} \frac{{{\mathbf{p}}}_i}{m_i} - \frac{p_{\xi_1}}{Q_1}\frac{{{\mathbf{p}}}_i}{m_i}\nonumber \\ - \dot{\epsilon} &=& \frac{{p_{\epsilon}}}{W} \nonumber \\ - \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P) -\frac{p_{\eta_1}}{Q^{\prime}_1}{p_{\epsilon}}\nonumber \\ - \dot{\xi}_k &=& \frac{p_{\xi_k}}{Q_k} \nonumber \\ - \dot{\eta}_k &=& \frac{p_{\eta_k}}{Q^{\prime}_k} \nonumber \\ - \dot{p}_{\xi_k} &=& G_k - \frac{p_{\xi_{k+1}}}{Q_{k+1}} \;\;\;\; k=1,\ldots, M-1 \nonumber \\ - \dot{p}_{\eta_k} &=& G^\prime_k - \frac{p_{\eta_{k+1}}}{Q^\prime_{k+1}} \;\;\;\; k=1,\ldots, M-1 \nonumber \\ - \dot{p}_{\xi_M} &=& G_M \nonumber \\ - \dot{p}_{\eta_M} &=& G^\prime_M, \nonumber \\\end{aligned} +.. math:: \begin{aligned} + \dot{{{\mathbf{r}}}}_i &=& \frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W} {{\mathbf{r}}}_i \nonumber \\ + \frac{\dot{{{\mathbf{p}}}}_i}{m_i} &=& \frac{1}{m_i}{{\mathbf{F}}}_i - \alpha\frac{{p_{\epsilon}}}{W} \frac{{{\mathbf{p}}}_i}{m_i} - \frac{p_{\xi_1}}{Q_1}\frac{{{\mathbf{p}}}_i}{m_i}\nonumber \\ + \dot{\epsilon} &=& \frac{{p_{\epsilon}}}{W} \nonumber \\ + \frac{\dot{{p_{\epsilon}}}}{W} &=& \frac{3V}{W}(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P) -\frac{p_{\eta_1}}{Q^{\prime}_1}{p_{\epsilon}}\nonumber \\ + \dot{\xi}_k &=& \frac{p_{\xi_k}}{Q_k} \nonumber \\ + \dot{\eta}_k &=& \frac{p_{\eta_k}}{Q^{\prime}_k} \nonumber \\ + \dot{p}_{\xi_k} &=& G_k - \frac{p_{\xi_{k+1}}}{Q_{k+1}} \;\;\;\; k=1,\ldots, M-1 \nonumber \\ + \dot{p}_{\eta_k} &=& G^\prime_k - \frac{p_{\eta_{k+1}}}{Q^\prime_{k+1}} \;\;\;\; k=1,\ldots, M-1 \nonumber \\ + \dot{p}_{\xi_M} &=& G_M \nonumber \\ + \dot{p}_{\eta_M} &=& G^\prime_M, \nonumber \\\end{aligned} + :label: eqnMTTKthermandbar where -.. math:: - - \begin{aligned} - P_{\mathrm{int}} &=& P_{\mathrm{kin}} - P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{{{\mathbf{p}}}_i^2}{2m_i} - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\right)\right] \nonumber \\ - G_1 &=& \sum_{i=1}^N \frac{{{\mathbf{p}}}^2_i}{m_i} - N_f kT \nonumber \\ - G_k &=& \frac{p^2_{\xi_{k-1}}}{2Q_{k-1}} - kT \;\; k = 2,\ldots,M \nonumber \\ - G^\prime_1 &=& \frac{{p_{\epsilon}}^2}{2W} - kT \nonumber \\ - G^\prime_k &=& \frac{p^2_{\eta_{k-1}}}{2Q^\prime_{k-1}} - kT \;\; k = 2,\ldots,M\end{aligned} +.. math:: \begin{aligned} + P_{\mathrm{int}} &=& P_{\mathrm{kin}} - P_{\mathrm{vir}} = \frac{1}{3V}\left[\sum_{i=1}^N \left(\frac{{{\mathbf{p}}}_i^2}{2m_i} - {{\mathbf{r}}}_i \cdot {{\mathbf{F}}}_i\right)\right] \nonumber \\ + G_1 &=& \sum_{i=1}^N \frac{{{\mathbf{p}}}^2_i}{m_i} - N_f kT \nonumber \\ + G_k &=& \frac{p^2_{\xi_{k-1}}}{2Q_{k-1}} - kT \;\; k = 2,\ldots,M \nonumber \\ + G^\prime_1 &=& \frac{{p_{\epsilon}}^2}{2W} - kT \nonumber \\ + G^\prime_k &=& \frac{p^2_{\eta_{k-1}}}{2Q^\prime_{k-1}} - kT \;\; k = 2,\ldots,M\end{aligned} + :label: eqnMTTKthermandbar2 The conserved quantity is now -.. math:: - - \begin{aligned} - H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) + \frac{p^2_\epsilon}{2W} + PV + \nonumber \\ - \sum_{k=1}^M\frac{p^2_{\xi_k}}{2Q_k} +\sum_{k=1}^M\frac{p^2_{\eta_k}}{2Q^{\prime}_k} + N_fkT\xi_1 + kT\sum_{i=2}^M \xi_k + kT\sum_{k=1}^M \eta_k\end{aligned} +.. math:: \begin{aligned} + H = \sum_{i=1}^{N} \frac{{{\mathbf{p}}}_i}{2m_i} + U\left({{\mathbf{r}}}_1,{{\mathbf{r}}}_2,\ldots,{{\mathbf{r}}}_N\right) + \frac{p^2_\epsilon}{2W} + PV + \nonumber \\ + \sum_{k=1}^M\frac{p^2_{\xi_k}}{2Q_k} +\sum_{k=1}^M\frac{p^2_{\eta_k}}{2Q^{\prime}_k} + N_fkT\xi_1 + kT\sum_{i=2}^M \xi_k + kT\sum_{k=1}^M \eta_k\end{aligned} + :label: eqnMTTKthermandbarconserved Returning to the Trotter decomposition formalism, for pressure control and temperature control \ :ref:`35 ` we get: -.. math:: - - \begin{aligned} - iL = iL_1 + iL_2 + iL_{\epsilon,1} + iL_{\epsilon,2} + iL_{\mathrm{NHC-baro}} + iL_{\mathrm{NHC}}\end{aligned} +.. math:: \begin{aligned} + iL = iL_1 + iL_2 + iL_{\epsilon,1} + iL_{\epsilon,2} + iL_{\mathrm{NHC-baro}} + iL_{\mathrm{NHC}}\end{aligned} + :label: eqnMTTKthermandbarTrotter where “NHC-baro” corresponds to the Nosè-Hoover chain of the barostat, and NHC corresponds to the NHC of the particles, -.. math:: - - \begin{aligned} - iL_1 &=& \sum_{i=1}^N \left[\frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W}{{\mathbf{r}}}_i\right]\cdot \frac{\partial}{\partial {{\mathbf{r}}}_i} \\ - iL_2 &=& \sum_{i=1}^N {{\mathbf{F}}}_i - \alpha \frac{{p_{\epsilon}}}{W}{{\mathbf{p}}}_i \cdot \frac{\partial}{\partial {{\mathbf{p}}}_i} \\ - iL_{\epsilon,1} &=& \frac{p_\epsilon}{W} \frac{\partial}{\partial \epsilon}\\ - iL_{\epsilon,2} &=& G_{\epsilon} \frac{\partial}{\partial p_\epsilon}\end{aligned} +.. math:: \begin{aligned} + iL_1 &=& \sum_{i=1}^N \left[\frac{{{\mathbf{p}}}_i}{m_i} + \frac{{p_{\epsilon}}}{W}{{\mathbf{r}}}_i\right]\cdot \frac{\partial}{\partial {{\mathbf{r}}}_i} \\ + iL_2 &=& \sum_{i=1}^N {{\mathbf{F}}}_i - \alpha \frac{{p_{\epsilon}}}{W}{{\mathbf{p}}}_i \cdot \frac{\partial}{\partial {{\mathbf{p}}}_i} \\ + iL_{\epsilon,1} &=& \frac{p_\epsilon}{W} \frac{\partial}{\partial \epsilon}\\ + iL_{\epsilon,2} &=& G_{\epsilon} \frac{\partial}{\partial p_\epsilon}\end{aligned} + :label: eqnMTTKthermandbarTrotter2 and where -.. math:: - - \begin{aligned} - G_{\epsilon} = 3V\left(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P\right)\end{aligned} +.. math:: \begin{aligned} + G_{\epsilon} = 3V\left(\alpha P_{\mathrm{kin}} - P_{\mathrm{vir}} - P\right)\end{aligned} + :label: eqnMTTKthermandbarTrotter3 Using the Trotter decomposition, we get -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right)\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \nonumber \\ - &&\exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \nonumber \\ - &&\exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \nonumber \nonumber \\ - &&\exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \nonumber \nonumber \\ - &&\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right)\exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right) + \mathcal{O}({\Delta t}^3)\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right)\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \nonumber \\ + &&\exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \nonumber \\ + &&\exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \nonumber \nonumber \\ + &&\exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \nonumber \nonumber \\ + &&\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right)\exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right) + \mathcal{O}({\Delta t}^3)\end{aligned} + :label: eqnMTTKthermandbarTrotterdecomp The action of :math:`\exp\left(iL_1 {\Delta t}\right)` comes from the solution of the the differential equation @@ -1614,6 +1594,7 @@ and :math:`{v_{\epsilon}}` constant with initial condition :math:`t=\Delta t`. This yields the evolution .. math:: {{\mathbf{r}}}_i({\Delta t}) = {{\mathbf{r}}}_i(0)e^{{v_{\epsilon}}{\Delta t}} + \Delta t {{\mathbf{v}}}_i(0) e^{{v_{\epsilon}}{\Delta t}/2} {\frac{\sinh{\left( {v_{\epsilon}}{\Delta t}/2\right)}}{{v_{\epsilon}}{\Delta t}/2}}. + :label: eqnMTTKthermandbarTrotterevol The action of :math:`\exp\left(iL_2 {\Delta t}/2\right)` comes from the solution of the differential equation @@ -1621,18 +1602,18 @@ solution of the differential equation \alpha{v_{\epsilon}}{{\mathbf{v}}}_i`, yielding .. math:: {{\mathbf{v}}}_i({\Delta t}/2) = {{\mathbf{v}}}_i(0)e^{-\alpha{v_{\epsilon}}{\Delta t}/2} + \frac{\Delta t}{2m_i}{{\mathbf{F}}}_i(0) e^{-\alpha{v_{\epsilon}}{\Delta t}/4}{\frac{\sinh{\left( \alpha{v_{\epsilon}}{\Delta t}/4\right)}}{\alpha{v_{\epsilon}}{\Delta t}/4}}. + :label: eqnMTTKthermandbarTrotterevol2 *md-vv-avek* uses the full step kinetic energies for determining the pressure with the pressure control, but the half-step-averaged kinetic energy for the temperatures, which can be written as a Trotter decomposition as -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right)\nonumber \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ - &&\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \\ - &&\exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right) + \mathcal{O}({\Delta t}^3)\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &=& \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right)\nonumber \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ + &&\exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \nonumber \\ + &&\exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\epsilon,2}{\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC-baro}}{\Delta t}/2\right) + \mathcal{O}({\Delta t}^3)\end{aligned} + :label: eqnvvavekTrotterdecomp With constraints, the equations become significantly more complicated, in that each of these equations need to be solved iteratively for the @@ -1657,32 +1638,29 @@ dynamics less \ :ref:`35 `. Standard velocity Verlet with Nosé-Hoover temperature control has a Trotter expansion -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &\approx& \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ - &&\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right).\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &\approx& \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right) \exp\left(iL_2 {\Delta t}/2\right) \nonumber \\ + &&\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right) \exp\left(iL_{\mathrm{NHC}}{\Delta t}/2\right).\end{aligned} + :label:eqnVVNHTrotter If the Nosé-Hoover chain is sufficiently slow with respect to the motions of the system, we can write an alternate integrator over :math:`n` steps for velocity Verlet as -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &\approx& (\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right)\left[\exp\left(iL_2 {\Delta t}/2\right)\right. \nonumber \\ - &&\left.\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right)\right]^n \exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right).\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &\approx& (\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right)\left[\exp\left(iL_2 {\Delta t}/2\right)\right. \nonumber \\ + &&\left.\exp\left(iL_1 {\Delta t}\right) \exp\left(iL_2 {\Delta t}/2\right)\right]^n \exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right).\end{aligned} + :label: eqnVVNHTrotter2 For pressure control, this becomes -.. math:: - - \begin{aligned} - \exp(iL{\Delta t}) &\approx& \exp\left(iL_{\mathrm{NHC-baro}}(n{\Delta t}/2)\right)\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right) \nonumber \nonumber \\ - &&\exp\left(iL_{\epsilon,2}(n{\Delta t}/2)\right) \left[\exp\left(iL_2 {\Delta t}/2\right)\right. \nonumber \nonumber \\ - &&\exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \nonumber \nonumber \\ - &&\left.\exp\left(iL_2 {\Delta t}/2\right)\right]^n \exp\left(iL_{\epsilon,2}(n{\Delta t}/2)\right) \nonumber \nonumber \\ - &&\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right)\exp\left(iL_{\mathrm{NHC-baro}}(n{\Delta t}/2)\right),\end{aligned} +.. math:: \begin{aligned} + \exp(iL{\Delta t}) &\approx& \exp\left(iL_{\mathrm{NHC-baro}}(n{\Delta t}/2)\right)\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right) \nonumber \nonumber \\ + &&\exp\left(iL_{\epsilon,2}(n{\Delta t}/2)\right) \left[\exp\left(iL_2 {\Delta t}/2\right)\right. \nonumber \nonumber \\ + &&\exp\left(iL_{\epsilon,1}{\Delta t}\right) \exp\left(iL_1 {\Delta t}\right) \nonumber \nonumber \\ + &&\left.\exp\left(iL_2 {\Delta t}/2\right)\right]^n \exp\left(iL_{\epsilon,2}(n{\Delta t}/2)\right) \nonumber \nonumber \\ + &&\exp\left(iL_{\mathrm{NHC}}(n{\Delta t}/2)\right)\exp\left(iL_{\mathrm{NHC-baro}}(n{\Delta t}/2)\right),\end{aligned} + :label: eqnVVNpressure where the box volume integration occurs every step, but the auxiliary variable integrations happen every :math:`n` steps. @@ -1749,6 +1727,7 @@ acceleration :math:`\mathbf{a}_h` into account the update algorithm for the velocities becomes .. math:: \mathbf{v}(t+{\frac{\Delta t}{2}})~=~\mathbf{f}_g * \lambda * \left[ \mathbf{v}(t-{\frac{\Delta t}{2}}) +\frac{\mathbf{F}(t)}{m}\Delta t + \mathbf{a}_h \Delta t \right], + :label: eqntotalupdate where :math:`g` and :math:`h` are group indices which differ per atom. diff --git a/docs/reference-manual/algorithms/normal-mode-analysis.rst b/docs/reference-manual/algorithms/normal-mode-analysis.rst index de14ba8fa1..9f30aca29d 100644 --- a/docs/reference-manual/algorithms/normal-mode-analysis.rst +++ b/docs/reference-manual/algorithms/normal-mode-analysis.rst @@ -5,12 +5,11 @@ Normal-mode analysis \ :ref:`54 `\ :ref:`56 ` can be performed using |Gromacs|, by diagonalization of the mass-weighted Hessian :math:`H`: -.. math:: - - \begin{aligned} - R^T M^{-1/2} H M^{-1/2} R &=& \mbox{diag}(\lambda_1,\ldots,\lambda_{3N}) - \\ - \lambda_i &=& (2 \pi \omega_i)^2\end{aligned} +.. math:: \begin{aligned} + R^T M^{-1/2} H M^{-1/2} R &=& \mbox{diag}(\lambda_1,\ldots,\lambda_{3N}) + \\ + \lambda_i &=& (2 \pi \omega_i)^2\end{aligned} + :label: eqnNMA where :math:`M` contains the atomic masses, :math:`R` is a matrix that contains the eigenvectors as columns, :math:`\lambda_i` are the @@ -19,22 +18,20 @@ eigenvalues and :math:`\omega_i` are the corresponding frequencies. First the Hessian matrix, which is a :math:`3N \times 3N` matrix where :math:`N` is the number of atoms, needs to be calculated: -.. math:: - - \begin{aligned} - H_{ij} &=& \frac{\partial^2 V}{\partial x_i \partial x_j}\end{aligned} +.. math:: \begin{aligned} + H_{ij} &=& \frac{\partial^2 V}{\partial x_i \partial x_j}\end{aligned} + :label: eqnNMAhessian where :math:`x_i` and :math:`x_j` denote the atomic x, y or z coordinates. In practice, this equation is not used, but the Hessian is calculated numerically from the force as: -.. math:: - - \begin{aligned} - H_{ij} &=& - - \frac{f_i({\bf x}+h{\bf e}_j) - f_i({\bf x}-h{\bf e}_j)}{2h} - \\ - f_i &=& - \frac{\partial V}{\partial x_i}\end{aligned} +.. math:: \begin{aligned} + H_{ij} &=& - + \frac{f_i({\bf x}+h{\bf e}_j) - f_i({\bf x}-h{\bf e}_j)}{2h} + \\ + f_i &=& - \frac{\partial V}{\partial x_i}\end{aligned} + :label: eqnNMAhessianfromforce where :math:`{\bf e}_j` is the unit vector in direction :math:`j`. It should be noted that for a usual normal-mode calculation, it is diff --git a/docs/reference-manual/algorithms/parallelization-domain-decomp.rst b/docs/reference-manual/algorithms/parallelization-domain-decomp.rst index 76b862a545..fa4a25cb8f 100644 --- a/docs/reference-manual/algorithms/parallelization-domain-decomp.rst +++ b/docs/reference-manual/algorithms/parallelization-domain-decomp.rst @@ -236,6 +236,7 @@ by the minimum cell size :math:`L_C`, which has the following lower limit: .. math:: L_C \geq \max(r_{\mathrm{mb}},r_{\mathrm{con}}) + :label: eqnDDmincellsize Without dynamic load balancing the system is actually allowed to scale beyond this limit when pressure scaling is used. **Note** that for diff --git a/docs/reference-manual/algorithms/replica-exchange.rst b/docs/reference-manual/algorithms/replica-exchange.rst index e776dcaba2..7a95113739 100644 --- a/docs/reference-manual/algorithms/replica-exchange.rst +++ b/docs/reference-manual/algorithms/replica-exchange.rst @@ -8,11 +8,10 @@ involves simulating multiple replicas of the same system at different temperatures and randomly exchanging the complete state of two replicas at regular intervals with the probability: -.. math:: - - P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ - \left(\frac{1}{k_B T_1} - \frac{1}{k_B T_2}\right)(U_1 - U_2) - \right] \right) +.. math:: P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ + \left(\frac{1}{k_B T_1} - \frac{1}{k_B T_2}\right)(U_1 - U_2) + \right] \right) + :label: eqnREX where :math:`T_1` and :math:`T_2` are the reference temperatures and :math:`U_1` and :math:`U_2` are the instantaneous potential energies of @@ -37,17 +36,17 @@ How should one choose the temperatures? The energy difference can be written as: .. math:: U_1 - U_2 = N_{df} \frac{c}{2} k_B (T_1 - T_2) + :label: eqnREXEdiff where :math:`N_{df}` is the total number of degrees of freedom of one replica and :math:`c` is 1 for harmonic potentials and around 2 for protein/water systems. If :math:`T_2 = (1+\epsilon) T_1` the probability becomes: -.. math:: - - P(1 \leftrightarrow 2) - = \exp\left( -\frac{\epsilon^2 c\,N_{df}}{2 (1+\epsilon)} \right) - \approx \exp\left(-\epsilon^2 \frac{c}{2} N_{df} \right) +.. math:: P(1 \leftrightarrow 2) + = \exp\left( -\frac{\epsilon^2 c\,N_{df}}{2 (1+\epsilon)} \right) + \approx \exp\left(-\epsilon^2 \frac{c}{2} N_{df} \right) + :label: eqnREXprob Thus for a probability of :math:`e^{-2}\approx 0.135` one obtains :math:`\epsilon \approx 2/\sqrt{c\,N_{df}}`. With all bonds constrained @@ -64,12 +63,11 @@ An extension to the REMD for the isobaric-isothermal ensemble was proposed by Okabe et al. :ref:`63 `. In this work the exchange probability is modified to: -.. math:: - - P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ - \left(\frac{1}{k_B T_1} - \frac{1}{k_B T_2}\right)(U_1 - U_2) + - \left(\frac{P_1}{k_B T_1} - \frac{P_2}{k_B T_2}\right)\left(V_1-V_2\right) - \right] \right) +.. math:: P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ + \left(\frac{1}{k_B T_1} - \frac{1}{k_B T_2}\right)(U_1 - U_2) + + \left(\frac{P_1}{k_B T_1} - \frac{P_2}{k_B T_2}\right)\left(V_1-V_2\right) + \right] \right) + :label: eqnREXexchangeprob where :math:`P_1` and :math:`P_2` are the respective reference pressures and :math:`V_1` and :math:`V_2` are the respective @@ -83,12 +81,10 @@ Hamiltonian replica exchange, each replica has a different Hamiltonian, defined by the free energy pathway specified for the simulation. The exchange probability to maintain the correct ensemble probabilities is: -.. math:: - - P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ - \left(\frac{1}{k_B T} - \frac{1}{k_B T}\right)((U_1(x_2) - U_1(x_1)) + (U_2(x_1) - U_2(x_2))) - \right] - \right) +.. math:: P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ + \left(\frac{1}{k_B T} - \frac{1}{k_B T}\right)((U_1(x_2) - U_1(x_1)) + (U_2(x_1) - U_2(x_2))) + \right]\right) + :label: eqnREXcorrectensemble The separate Hamiltonians are defined by the free energy functionality of |Gromacs|, with swaps made between the different values of @@ -97,11 +93,10 @@ of |Gromacs|, with swaps made between the different values of Hamiltonian and temperature replica exchange can also be performed simultaneously, using the acceptance criteria: -.. math:: - - P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ - \left(\frac{1}{k_B T} - \right)(\frac{U_1(x_2) - U_1(x_1)}{k_B T_1} + \frac{U_2(x_1) - U_2(x_2)}{k_B T_2}) - \right] \right) +.. math:: P(1 \leftrightarrow 2)=\min\left(1,\exp\left[ + \left(\frac{1}{k_B T} - \right)(\frac{U_1(x_2) - U_1(x_1)}{k_B T_1} + \frac{U_2(x_1) - U_2(x_2)}{k_B T_2}) + \right] \right) + :label: eqnREXacceptance Gibbs sampling replica exchange has also been implemented in |Gromacs| :ref:`64 `. In Gibbs sampling replica exchange, diff --git a/docs/reference-manual/algorithms/shell-molecular-dynamics.rst b/docs/reference-manual/algorithms/shell-molecular-dynamics.rst index b4bcd25f6f..6fdf32d198 100644 --- a/docs/reference-manual/algorithms/shell-molecular-dynamics.rst +++ b/docs/reference-manual/algorithms/shell-molecular-dynamics.rst @@ -12,45 +12,47 @@ applications of shell models in |Gromacs| have been published for Optimization of the shell positions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The force -:math:`\mathbf{F}`\ :math:`_S` on a shell +The force :math:`\mathbf{F}`\ :math:`_S` on a shell particle :math:`S` can be decomposed into two components .. math:: \mathbf{F}_S ~=~ \mathbf{F}_{bond} + \mathbf{F}_{nb} + :label: eqnshellforcedecomp -where -:math:`\mathbf{F}_{bond}` denotes the +where :math:`\mathbf{F}_{bond}` denotes the component representing the polarization energy, usually represented by a -harmonic potential and -:math:`\mathbf{F}_{nb}` is the sum of Coulomb +harmonic potential and :math:`\mathbf{F}_{nb}` is the sum of Coulomb and van der Waals interactions. If we assume that :math:`\mathbf{F}_{nb}` is almost constant we can analytically derive the optimal position of the shell, i.e. where -:math:`\mathbf{F}_S` = 0. If we have the -shell S connected to atom A we have +:math:`\mathbf{F}_S` = 0. If we have the shell S connected to atom A we have .. math:: \mathbf{F}_{bond} ~=~ k_b \left( \mathbf{x}_S - \mathbf{x}_A\right). + :label: eqnshell -In an iterative solver, we have positions -:math:`\mathbf{x}_S(n)` where :math:`n` is +In an iterative solver, we have positions :math:`\mathbf{x}_S(n)` where :math:`n` is the iteration count. We now have at iteration :math:`n` .. math:: \mathbf{F}_{nb} ~=~ \mathbf{F}_S - k_b \left( \mathbf{x}_S(n) - \mathbf{x}_A\right) + :label: eqnshellsolv -and the optimal position for the shells :math:`x_S(n+1)` thus follows -from +and the optimal position for the shells :math:`x_S(n+1)` thus follows from .. math:: \mathbf{F}_S - k_b \left( \mathbf{x}_S(n) - \mathbf{x}_A\right) + k_b \left( \mathbf{x}_S(n+1) - \mathbf{x}_A\right) = 0 + :label: eqnshelloptpos if we write .. math:: \Delta \mathbf{x}_S = \mathbf{x}_S(n+1) - \mathbf{x}_S(n) + :label: eqnshelloptpos2 we finally obtain .. math:: \Delta \mathbf{x}_S = \mathbf{F}_S/k_b + :label: eqnshelloptpos3 which then yields the algorithm to compute the next trial in the optimization of shell positions .. math:: \mathbf{x}_S(n+1) ~=~ \mathbf{x}_S(n) + \mathbf{F}_S/k_b. + :label: eqnshelloptpos4 + diff --git a/docs/reference-manual/analysis/bond-angle-dihedral.rst b/docs/reference-manual/analysis/bond-angle-dihedral.rst index b24f2cac1f..99f05d6bc3 100644 --- a/docs/reference-manual/analysis/bond-angle-dihedral.rst +++ b/docs/reference-manual/analysis/bond-angle-dihedral.rst @@ -85,7 +85,7 @@ uses the normal vector perpendicular to the plane. See .. _fig-sgangle: .. figure:: plots/sgangle.* - :width: 3.50000cm + :width: 10.00000cm Angle options of :ref:`gmx gangle `: A. Angle between two vectors. B. Angle between two planes. C. Angle between a vector and the diff --git a/docs/reference-manual/analysis/correlation-function.rst b/docs/reference-manual/analysis/correlation-function.rst index 80267104e8..ea1fbd6541 100644 --- a/docs/reference-manual/analysis/correlation-function.rst +++ b/docs/reference-manual/analysis/correlation-function.rst @@ -19,6 +19,7 @@ cross-correlation function from two properties :math:`f(t)` and :math:`g(t)`: .. math:: C_{fg}(t) ~=~ \left\langle f(\xi) g(\xi+t)\right\rangle_{\xi} + :label: eqncrosscorr however, in |Gromacs| there is no standard mechanism to do this (**note:** you can use the ``xmgr`` program to compute cross correlations). @@ -49,6 +50,7 @@ of length :math:`M\Delta t`, where :math:`M \leq N/2` we can compute all points with the same statistical accuracy: .. math:: C_f(j\Delta t) ~=~ \frac{1}{M}\sum_{i=0}^{N-1-M} f(i\Delta t)f((i+j)\Delta t) + :label: eqncorrstataccuracy Here of course :math:`j < M`. :math:`M` is sometimes referred to as the time lag of the correlation function. When we decide to do this, we @@ -63,6 +65,7 @@ the time lag are included, *e.g.* using :math:`k` time origins with spacing of :math:`M\Delta t` (where :math:`kM \leq N`): .. math:: C_f(j\Delta t) ~=~ \frac{1}{k}\sum_{i=0}^{k-1} f(iM\Delta t)f((iM+j)\Delta t) + :label: eqncorrblockaveraging However, one needs very long simulations to get good accuracy this way, because there are many fewer points that contribute to the ACF. @@ -112,11 +115,13 @@ The program :ref:`gmx velacc ` calculates the *velocity autocorrelation function*. .. math:: C_{\mathbf{v}} (\tau) ~=~ \langle {\mathbf{v}}_i(\tau) \cdot {\mathbf{v}}_i(0) \rangle_{i \in A} + :label: eqnvelocityautocorr The self diffusion coefficient can be calculated using the Green-Kubo relation \ :ref:`108 `: .. math:: D_A ~=~ {1\over 3} \int_0^{\infty} \langle {\bf v}_i(t) \cdot {\bf v}_i(0) \rangle_{i \in A} \; dt + :label: eqndiffcoeff which is just the integral of the velocity autocorrelation function. There is a widely-held belief that the velocity ACF converges faster @@ -130,10 +135,9 @@ Another important quantity is the dipole correlation time. The *dipole correlation function* for particles of type :math:`A` is calculated as follows by :ref:`gmx dipoles `: -.. math:: - - C_{\mu} (\tau) ~=~ - \langle {\bf \mu}_i(\tau) \cdot {\bf \mu}_i(0) \rangle_{i \in A} +.. math:: C_{\mu} (\tau) ~=~ + \langle {\bf \mu}_i(\tau) \cdot {\bf \mu}_i(0) \rangle_{i \in A} + :label: eqndipolecorrfunc with :math:`{\bf \mu}_i = \sum_{j \in i} {\bf r}_j q_j`. The dipole correlation time can be computed using :eq:`eqn. %s `. diff --git a/docs/reference-manual/analysis/covariance-analysis.rst b/docs/reference-manual/analysis/covariance-analysis.rst index d230ad8045..cdd2b83c30 100644 --- a/docs/reference-manual/analysis/covariance-analysis.rst +++ b/docs/reference-manual/analysis/covariance-analysis.rst @@ -8,22 +8,20 @@ essential dynamics :ref:`169 `\ , can find correlated motions. It uses the covariance matrix :math:`C` of the atomic coordinates: -.. math:: - - C_{ij} = \left \langle - M_{ii}^{\frac{1}{2}} (x_i - \langle x_i \rangle) - M_{jj}^{\frac{1}{2}} (x_j - \langle x_j \rangle) - \right \rangle +.. math:: C_{ij} = \left \langle + M_{ii}^{\frac{1}{2}} (x_i - \langle x_i \rangle) + M_{jj}^{\frac{1}{2}} (x_j - \langle x_j \rangle) + \right \rangle + :label: eqncovmatrixcoord where :math:`M` is a diagonal matrix containing the masses of the atoms (mass-weighted analysis) or the unit matrix (non-mass weighted analysis). :math:`C` is a symmetric :math:`3N \times 3N` matrix, which can be diagonalized with an orthonormal transformation matrix :math:`R`: -.. math:: - - R^T C R = \mbox{diag}(\lambda_1,\lambda_2,\ldots,\lambda_{3N}) - ~~~~\mbox{where}~~\lambda_1 \geq \lambda_2 \geq \ldots \geq \lambda_{3N} +.. math:: R^T C R = \mbox{diag}(\lambda_1,\lambda_2,\ldots,\lambda_{3N}) + ~~~~\mbox{where}~~\lambda_1 \geq \lambda_2 \geq \ldots \geq \lambda_{3N} + :label: eqnorthnormtransformmatrix The columns of :math:`R` are the eigenvectors, also called principal or essential modes. :math:`R` defines a transformation to a new coordinate @@ -31,6 +29,7 @@ system. The trajectory can be projected on the principal modes to give the principal components :math:`p_i(t)`: .. math:: {\bf p}(t) = R^T M^{\frac{1}{2}} ({\bf x}(t) - \langle {\bf x} \rangle) + :label: eqnprinccomponents The eigenvalue :math:`\lambda_i` is the mean square fluctuation of principal component :math:`i`. The first few principal modes often @@ -38,10 +37,9 @@ describe collective, global motions in the system. The trajectory can be filtered along one (or more) principal modes. For one principal mode :math:`i` this goes as follows: -.. math:: - - {\bf x}^f(t) = - \langle {\bf x} \rangle + M^{-\frac{1}{2}} R_{ * i} \, p_i(t) +.. math:: {\bf x}^f(t) = + \langle {\bf x} \rangle + M^{-\frac{1}{2}} R_{ * i} \, p_i(t) + :label: eqnprincmodei When the analysis is performed on a macromolecule, one often wants to remove the overall rotation and translation to look at the internal @@ -67,31 +65,30 @@ columns of the rotation matrix :math:`R`. For a symmetric and diagonally-dominant matrix :math:`A` of size :math:`3N \times 3N` the square root can be calculated as: -.. math:: - - A^\frac{1}{2} = - R \, \mbox{diag}(\lambda_1^\frac{1}{2},\lambda_2^\frac{1}{2},\ldots,\lambda_{3N}^\frac{1}{2}) \, R^T +.. math:: A^\frac{1}{2} = + R \, \mbox{diag}(\lambda_1^\frac{1}{2},\lambda_2^\frac{1}{2},\ldots,\lambda_{3N}^\frac{1}{2}) \, R^T + :label: eqnmatrixsquareroot It can be verified easily that the product of this matrix with itself gives :math:`A`. Now we can define a difference :math:`d` between covariance matrices :math:`A` and :math:`B` as follows: -.. math:: - - \begin{aligned} - d(A,B) & = & \sqrt{\mbox{tr}\left(\left(A^\frac{1}{2} - B^\frac{1}{2}\right)^2\right) - } - \\ & = & - \sqrt{\mbox{tr}\left(A + B - 2 A^\frac{1}{2} B^\frac{1}{2}\right)} - \\ & = & - \left( \sum_{i=1}^N \left( \lambda_i^A + \lambda_i^B \right) - - 2 \sum_{i=1}^N \sum_{j=1}^N \sqrt{\lambda_i^A \lambda_j^B} - \left(R_i^A \cdot R_j^B\right)^2 \right)^\frac{1}{2}\end{aligned} +.. math:: \begin{aligned} + d(A,B) & = & \sqrt{\mbox{tr}\left(\left(A^\frac{1}{2} - B^\frac{1}{2}\right)^2\right) + } + \\ & = & + \sqrt{\mbox{tr}\left(A + B - 2 A^\frac{1}{2} B^\frac{1}{2}\right)} + \\ & = & + \left( \sum_{i=1}^N \left( \lambda_i^A + \lambda_i^B \right) + - 2 \sum_{i=1}^N \sum_{j=1}^N \sqrt{\lambda_i^A \lambda_j^B} + \left(R_i^A \cdot R_j^B\right)^2 \right)^\frac{1}{2}\end{aligned} + :label: eqnmatrixdiff where tr is the trace of a matrix. We can now define the overlap :math:`s` as: .. math:: s(A,B) = 1 - \frac{d(A,B)}{\sqrt{\mbox{tr}A + \mbox{tr} B}} + :label: eqnmatrixoverlap The overlap is 1 if and only if matrices :math:`A` and :math:`B` are identical. It is 0 when the sampled subspaces are completely orthogonal. @@ -102,10 +99,9 @@ by :math:`m` orthonormal vectors :math:`{\bf w}_1,\ldots,{\bf w}_m` with a reference subspace spanned by :math:`n` orthonormal vectors :math:`{\bf v}_1,\ldots,{\bf v}_n` can be quantified as follows: -.. math:: - - \mbox{overlap}({\bf v},{\bf w}) = - \frac{1}{n} \sum_{i=1}^n \sum_{j=1}^m ({\bf v}_i \cdot {\bf w}_j)^2 +.. math:: \mbox{overlap}({\bf v},{\bf w}) = + \frac{1}{n} \sum_{i=1}^n \sum_{j=1}^m ({\bf v}_i \cdot {\bf w}_j)^2 + :label: eqnsubspaceoverlap The overlap will increase with increasing :math:`m` and will be 1 when set :math:`{\bf v}` is a subspace of set :math:`{\bf w}`. The @@ -121,11 +117,10 @@ index \ :ref:`170 `, :ref:`171 `. The eigenvalues are proportional to the index to the power :math:`-2`. The cosine content is defined as: -.. math:: - - \frac{2}{T} - \left( \int_0^T \cos\left(\frac{i \pi t}{T}\right) \, p_i(t) \mbox{d} t \right)^2 - \left( \int_0^T p_i^2(t) \mbox{d} t \right)^{-1} +.. math:: \frac{2}{T} + \left( \int_0^T \cos\left(\frac{i \pi t}{T}\right) \, p_i(t) \mbox{d} t \right)^2 + \left( \int_0^T p_i^2(t) \mbox{d} t \right)^{-1} + :label: eqneigenvaluecosine When the cosine content of the first few principal components is close to 1, the largest fluctuations are not connected with the potential, but diff --git a/docs/reference-manual/analysis/curve-fitting.rst b/docs/reference-manual/analysis/curve-fitting.rst index 2929a35206..dafc3eb2e6 100644 --- a/docs/reference-manual/analysis/curve-fitting.rst +++ b/docs/reference-manual/analysis/curve-fitting.rst @@ -57,11 +57,10 @@ Error estimation Under the hood |Gromacs| implements some more fitting functions, namely a function to estimate the error in time-correlated data due to Hess \ :ref:`149 `: -.. math:: - - \varepsilon^2(t) = - \alpha\tau_1\left(1+\frac{\tau_1}{t}\left(e^{-t/\tau_1}-1\right)\right) - + (1-\alpha)\tau_2\left(1+\frac{\tau_2}{t}\left(e^{-t/\tau_2}-1\right)\right) +.. math:: \varepsilon^2(t) = + \alpha\tau_1\left(1+\frac{\tau_1}{t}\left(e^{-t/\tau_1}-1\right)\right) + + (1-\alpha)\tau_2\left(1+\frac{\tau_2}{t}\left(e^{-t/\tau_2}-1\right)\right) + :label: eqntimecorrerror where :math:`\tau_1` and :math:`\tau_2` are time constants (with :math:`\tau_2 \ge \tau_1`) and :math:`\alpha` usually is close to 1 (in @@ -69,6 +68,7 @@ the fitting procedure it is enforced that :math:`0\leq\alpha\leq 1`). This is used in :ref:`gmx analyze ` for error estimation using .. math:: \lim_{t\rightarrow\infty}\varepsilon(t) = \sigma\sqrt{\frac{2(\alpha\tau_1+(1-\alpha)\tau_2)}{T}} + :label: eqnanalyzeerrorest where :math:`\sigma` is the standard deviation of the data set and :math:`T` is the total simulation time \ :ref:`149 `. @@ -79,10 +79,9 @@ Interphase boundary demarcation In order to determine the position and width of an interface, Steen-Sæthre *et al.* fitted a density profile to the following function -.. math:: - - f(x) ~=~ \frac{a_0+a_1}{2} - \frac{a_0-a_1}{2}{\rm - erf}\left(\frac{x-a_2}{a_3^2}\right) +.. math:: f(x) ~=~ \frac{a_0+a_1}{2} - \frac{a_0-a_1}{2}{\rm + erf}\left(\frac{x-a_2}{a_3^2}\right) + :label: eqndesprofilefunc where :math:`a_0` and :math:`a_1` are densities of different phases, :math:`x` is the coordinate normal to the interface, :math:`a_2` is the @@ -97,10 +96,9 @@ In order to establish the transverse current autocorrelation function (useful for computing viscosity  \ :ref:`164 `) the following function is fitted: -.. math:: - - f(x) ~=~ e^{-\nu}\left({\rm cosh}(\omega\nu)+\frac{{\rm - sinh}(\omega\nu)}{\omega}\right) +.. math:: f(x) ~=~ e^{-\nu}\left({\rm cosh}(\omega\nu)+\frac{{\rm + sinh}(\omega\nu)}{\omega}\right) + :label: eqntransverseautocorrfunc with :math:`\nu = x/(2a_0)` and :math:`\omega = \sqrt{1-a_1}`. This is implemented in :ref:`gmx tcaf `. @@ -115,10 +113,9 @@ function \ :ref:`160 `, however this is often hampered by the noisy tail of the ACF. A workaround to this is fitting the ACF to the following function \ :ref:`166 `: -.. math:: - - f(t)/f(0) = (1-C) {\rm cos}(\omega t) e^{-(t/\tau_f)^{\beta_f}} + C - e^{-(t/\tau_s)^{\beta_s}} +.. math:: f(t)/f(0) = (1-C) {\rm cos}(\omega t) e^{-(t/\tau_f)^{\beta_f}} + C + e^{-(t/\tau_s)^{\beta_s}} + :label: eqnviscestpressureautocorr where :math:`\omega` is the frequency of rapid pressure oscillations (mainly due to bonded forces in molecular simulations), :math:`\tau_f` @@ -130,6 +127,7 @@ After a fit, the integral of the function :math:`f(t)` is used to compute the viscosity: .. math:: \eta = \frac{V}{k_B T}\int_0^{\infty} f(t) dt + :label: eqncompviscosity This equation has been applied to computing the bulk and shear viscosity using different elements from the pressure tensor \ :ref:`167 `. diff --git a/docs/reference-manual/analysis/dihedral-pca.rst b/docs/reference-manual/analysis/dihedral-pca.rst index 0516e40749..8c31695026 100644 --- a/docs/reference-manual/analysis/dihedral-pca.rst +++ b/docs/reference-manual/analysis/dihedral-pca.rst @@ -36,17 +36,16 @@ Hydrogen bonds and acceptors A. To determine if an H-bond exists, a geometrical criterion is used, see also :numref:`Fig. %s `: - .. math:: - - \begin{array}{rclcl} - r & \leq & r_{HB} & = & 0.35~\mbox{nm} \\ - \alpha & \leq & \alpha_{HB} & = & 30^o \\ - \end{array} + .. math:: \begin{array}{rclcl} + r & \leq & r_{HB} & = & 0.35~\mbox{nm} \\ + \alpha & \leq & \alpha_{HB} & = & 30^o \\ + \end{array} + :label: eqnhbondgeomtric .. _fig-hbond: .. figure:: plots/hbond.* - :width: 2.50000cm + :width: 7.50000cm Geometrical Hydrogen bond criterion. @@ -61,7 +60,7 @@ the following ways: .. _fig-hbondinsert: .. figure:: plots/hbond-insert.* - :width: 3.50000cm + :width: 7.50000cm Insertion of water into an H-bond. (1) Normal H-bond between two residues. (2) H-bonding bridge via a water molecule. diff --git a/docs/reference-manual/analysis/general-properties.rst b/docs/reference-manual/analysis/general-properties.rst index 0b9daab49c..1fbc7b8445 100644 --- a/docs/reference-manual/analysis/general-properties.rst +++ b/docs/reference-manual/analysis/general-properties.rst @@ -11,6 +11,7 @@ General properties The *center-of-mass velocity*, defined as .. math:: {\bf v}_{com} = {1 \over M} \sum_{i=1}^N m_i {\bf v}_i + :label: eqncomvelocity with :math:`M = \sum_{i=1}^N m_i` the total mass of the system, can be monitored in time by the program :ref:`gmx traj ` ``-com -ov``. It is however diff --git a/docs/reference-manual/analysis/mean-square-displacement.rst b/docs/reference-manual/analysis/mean-square-displacement.rst index da21b56914..268325b630 100644 --- a/docs/reference-manual/analysis/mean-square-displacement.rst +++ b/docs/reference-manual/analysis/mean-square-displacement.rst @@ -9,10 +9,9 @@ Mean Square Displacement particles of type :math:`A`, one can use the Einstein relation :ref:`108 `: - .. math:: - - \lim_{t \rightarrow \infty} \langle - \|{\bf r}_i(t) - {\bf r}_i(0)\|^2 \rangle_{i \in A} ~=~ 6 D_A t + .. math:: \lim_{t \rightarrow \infty} \langle + \|{\bf r}_i(t) - {\bf r}_i(0)\|^2 \rangle_{i \in A} ~=~ 6 D_A t + :label: eqnmsd | This *mean square displacement* and :math:`D_A` are calculated by the program :ref:`gmx msd `. Normally diff --git a/docs/reference-manual/analysis/plots/sgangle.pdf b/docs/reference-manual/analysis/plots/sgangle.pdf index 43a835e18f79055ef613aada8571b1b8ceec3463..5d1bbf5c5166c82f3771e1499617e003cdb47981 100644 GIT binary patch literal 7330 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 VAhDjO-i1rTp#UBpMJ*-3e*w~9NUZ<> literal 7199 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 f2(<|uuZ!cA=7E8`V~!DriGv{&TwF@p$`tA + transform="matrix(0,1.25,1.25,0,-1616.0173,-425.73952)">A + B + id="g8860" + transform="translate(8.5333338,-17.066667)">B + C + transform="rotate(90,365.8304,1446.3872)" + id="g8860-5">C + z + style="fill:none;stroke:#000000;stroke-width:0.85333335px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Mend-7)" + d="M 417.03043,1591.4539 H 357.2971" + id="path9638" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cc" />z + D + xml:space="preserve" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12.80000019px;line-height:0%;font-family:sans-serif;-inkscape-font-specification:Sans;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672" + x="1608.5206" + y="425.56378" + id="text6324-0-3-9" + transform="matrix(0,1,1,0,0,0)">D + \ No newline at end of file + style="fill:none;stroke:#000000;stroke-width:0.85333335;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2.56, 2.56;stroke-dashoffset:0;stroke-opacity:1;marker-start:url(#marker9565)" + d="m 408.4971,1625.5872 -38.4,38.4" + id="path10096" + inkscape:connector-curvature="0" /> \ No newline at end of file diff --git a/docs/reference-manual/analysis/radial-distribution-function.rst b/docs/reference-manual/analysis/radial-distribution-function.rst index 197b9db076..0d106e488e 100644 --- a/docs/reference-manual/analysis/radial-distribution-function.rst +++ b/docs/reference-manual/analysis/radial-distribution-function.rst @@ -6,14 +6,13 @@ Radial distribution functions :math:`g_{AB}(r)` between particles of type :math:`A` and :math:`B` is defined in the following way: -.. math:: - - \begin{array}{rcl} - g_{AB}(r)&=& {\displaystyle \frac{\langle \rho_B(r) \rangle}{\langle\rho_B\rangle_{local}}} \\ - &=& {\displaystyle \frac{1}{\langle\rho_B\rangle_{local}}}{\displaystyle \frac{1}{N_A}} - \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} - {\displaystyle \frac{\delta( r_{ij} - r )}{4 \pi r^2}} \\ - \end{array} +.. math:: \begin{array}{rcl} + g_{AB}(r)&=& {\displaystyle \frac{\langle \rho_B(r) \rangle}{\langle\rho_B\rangle_{local}}} \\ + &=& {\displaystyle \frac{1}{\langle\rho_B\rangle_{local}}}{\displaystyle \frac{1}{N_A}} + \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} + {\displaystyle \frac{\delta( r_{ij} - r )}{4 \pi r^2}} \\ + \end{array} + :label: eqnrdfdefine with :math:`\langle\rho_B(r)\rangle` the particle density of type :math:`B` at a distance :math:`r` around particles :math:`A`, and @@ -52,11 +51,13 @@ dependent rdf :math:`g_{AB}(r,\theta)`, where the angle :math:`\theta` is defined with respect to a certain laboratory axis :math:`{\bf e}`, see :numref:`Fig. %s ` B. -.. math:: +.. math:: g_{AB}(r,\theta) = {1 \over \langle\rho_B\rangle_{local,\:\theta }} + {1 \over N_A} \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} {\delta( r_{ij} - r ) + \delta(\theta_{ij} -\theta) \over 2 \pi r^2 sin(\theta)} + :label: eqnrdfangleaxis1 - \begin{aligned} - g_{AB}(r,\theta) &=& {1 \over \langle\rho_B\rangle_{local,\:\theta }} {1 \over N_A} \sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} {\delta( r_{ij} - r ) \delta(\theta_{ij} -\theta) \over 2 \pi r^2 sin(\theta)}\\ - cos(\theta_{ij}) &=& {{\bf r}_{ij} \cdot {\bf e} \over \|r_{ij}\| \;\| e\| }\end{aligned} +.. math:: cos(\theta_{ij}) = {{\bf r}_{ij} \cdot {\bf e} \over \|r_{ij}\| \;\| e\| } + :label: eqnrdfangleaxis2 This :math:`g_{AB}(r,\theta)` is useful for analyzing anisotropic systems. **Note** that in this case the normalization diff --git a/docs/reference-manual/analysis/using-groups.rst b/docs/reference-manual/analysis/using-groups.rst index 4b509d6e39..c6cf7d2425 100644 --- a/docs/reference-manual/analysis/using-groups.rst +++ b/docs/reference-manual/analysis/using-groups.rst @@ -4,7 +4,7 @@ Using Groups ------------ | In chapter :ref:`algorithms`, it was explained how *groups of atoms* can - be used in mdrun (see sec. :ref:`groupconcept`). In most analysis + be used in :ref:`mdrun ` (see sec. :ref:`groupconcept`). In most analysis programs, groups of atoms must also be chosen. Most programs can generate several default index groups, but groups can always be read from an index file. Let’s consider the example of a simulation of a @@ -13,6 +13,7 @@ Using Groups to B, we have to calculate: .. math:: 4\pi r^2 g_{AB}(r) ~=~ V~\sum_{i \in A}^{N_A} \sum_{j \in B}^{N_B} P(r) + :label: eqnanalysisrdf | where :math:`V` is the volume and :math:`P(r)` is the probability of finding a B atom at distance :math:`r` from an A atom. diff --git a/docs/reference-manual/averages.rst b/docs/reference-manual/averages.rst index a27e171ed5..e64e58c536 100644 --- a/docs/reference-manual/averages.rst +++ b/docs/reference-manual/averages.rst @@ -25,8 +25,9 @@ when :math:`\sigma_x^{{\frac{1}{2}}}` is small compared to the values of accurate .. math:: \sigma_x ~=~ \sum_{i=1}^{N_x} [x_i - \left]^2 + :label: eqnvar1equivalent - with +with .. math:: \left ~=~ \frac{1}{N_x} \sum_{i=1}^{N_x} x_i :label: eqnvar2 @@ -42,6 +43,7 @@ sums, which allows for a sequential update algorithm. Define the partial sum .. math:: X_{n,m} ~=~ \sum_{i=n}^{m} x_i + :label: eqnpartialsum and the partial variance @@ -68,7 +70,7 @@ For :math:`n=1` one finds :label: eqnsig1 and for :math:`n=1` and :math:`k=1` -(:eq:`eqn. %s `) becomes +:eq:`eqn. %s ` becomes .. math:: \begin{aligned} \sigma_{1,m+1} &=& \sigma_{1,m} + @@ -83,14 +85,16 @@ where we have used the relation .. math:: X_{1,m+1} ~=~ X_{1,m} + x_{m+1} :label: eqnsimplevar1 -Using formulae (:eq:`eqn. %s `) and -(:eq:`eqn. %s `) the average +Using formulae :eq:`eqn. %s ` and +:eq:`eqn. %s ` the average .. math:: \left ~=~ \frac{X_{1,N_x}}{N_x} + :label: eqnfinalaverage and the fluctuation .. math:: \left<(\Delta x)^2\right>^{{\frac{1}{2}}} = \left[\frac {\sigma_{1,N_x}}{N_x}\right]^{{\frac{1}{2}}} + :label: eqnfinalfluctuation can be obtained by one sweep through the data. @@ -120,32 +124,28 @@ Using :eq:`eqns. %s ` and :eq:`%s ` the average and standard deviation over part of the trajectory can be computed as: -.. math:: - - \begin{aligned} - X_{m+1,m+k} &=& X_{1,m+k} - X_{1,m} \\ - \sigma_{m+1,m+k} &=& \sigma_{1,m+k}-\sigma_{1,m} - \left[~\frac{X_{1,m}}{m} - \frac{X_{1,m+k}}{m+k}~\right]^{2}~ \frac{m(m+k)}{k}\end{aligned} +.. math:: \begin{aligned} + X_{m+1,m+k} &=& X_{1,m+k} - X_{1,m} \\ + \sigma_{m+1,m+k} &=& \sigma_{1,m+k}-\sigma_{1,m} - \left[~\frac{X_{1,m}}{m} - \frac{X_{1,m+k}}{m+k}~\right]^{2}~ \frac{m(m+k)}{k}\end{aligned} + :label: eqnaveragesimpart or, more generally (with :math:`p \geq 1` and :math:`q \geq p`): -.. math:: - - \begin{aligned} - X_{p,q} &=& X_{1,q} - X_{1,p-1} \\ - \sigma_{p,q} &=& \sigma_{1,q}-\sigma_{1,p-1} - \left[~\frac{X_{1,p-1}}{p-1} - \frac{X_{1,q}}{q}~\right]^{2}~ \frac{(p-1)q}{q-p+1}\end{aligned} +.. math:: \begin{aligned} + X_{p,q} &=& X_{1,q} - X_{1,p-1} \\ + \sigma_{p,q} &=& \sigma_{1,q}-\sigma_{1,p-1} - \left[~\frac{X_{1,p-1}}{p-1} - \frac{X_{1,q}}{q}~\right]^{2}~ \frac{(p-1)q}{q-p+1}\end{aligned} + :label: eqnaveragesimpartgeneral **Note** that implementation of this is not entirely trivial, since energies are not stored every time step of the simulation. We therefore have to construct :math:`X_{1,p-1}` and :math:`\sigma_{1,p-1}` from the -information at time :math:`p` using -:eq:`eqns. %s ` and +information at time :math:`p` using :eq:`eqns. %s ` and :eq:`%s `: -.. math:: - - \begin{aligned} - X_{1,p-1} &=& X_{1,p} - x_p \\ - \sigma_{1,p-1} &=& \sigma_{1,p} - \frac {[~X_{1,p-1} - (p-1) x_{p}~]^2}{(p-1)p}\end{aligned} +.. math:: \begin{aligned} + X_{1,p-1} &=& X_{1,p} - x_p \\ + \sigma_{1,p-1} &=& \sigma_{1,p} - \frac {[~X_{1,p-1} - (p-1) x_{p}~]^2}{(p-1)p}\end{aligned} + :label: eqnfinalaveragesimpartnote Combining two simulations ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -165,46 +165,46 @@ When we want to compute the partial variance from the two components we have to make a correction :math:`\Delta\sigma`: .. math:: \sigma_{1,n+m}^{AB} ~=~ \sigma_{1,n}^A + \sigma_{1,m}^B +\Delta\sigma + :label: eqnscombcorr if we define :math:`x_i^{AB}` as the combined and renumbered set of data points we can write: .. math:: \sigma_{1,n+m}^{AB} ~=~ \sum_{i=1}^{n+m} \left[x_i^{AB} - \frac{X_{1,n+m}^{AB}}{n+m}\right]^2 + :label: eqnpscombpoints and thus -.. math:: - - \sum_{i=1}^{n+m} \left[x_i^{AB} - \frac{X_{1,n+m}^{AB}}{n+m}\right]^2 ~=~ - \sum_{i=1}^{n} \left[x_i^{A} - \frac{X_{1,n}^{A}}{n}\right]^2 + - \sum_{i=1}^{m} \left[x_i^{B} - \frac{X_{1,m}^{B}}{m}\right]^2 +\Delta\sigma +.. math:: \sum_{i=1}^{n+m} \left[x_i^{AB} - \frac{X_{1,n+m}^{AB}}{n+m}\right]^2 ~=~ + \sum_{i=1}^{n} \left[x_i^{A} - \frac{X_{1,n}^{A}}{n}\right]^2 + + \sum_{i=1}^{m} \left[x_i^{B} - \frac{X_{1,m}^{B}}{m}\right]^2 +\Delta\sigma + :label: eqnpscombresult or -.. math:: - - \begin{aligned} - \sum_{i=1}^{n+m} \left[(x_i^{AB})^2 - 2 x_i^{AB}\frac{X^{AB}_{1,n+m}}{n+m} + \left(\frac{X^{AB}_{1,n+m}}{n+m}\right)^2 \right] &-& \nonumber \\ - \sum_{i=1}^{n} \left[(x_i^{A})^2 - 2 x_i^{A}\frac{X^A_{1,n}}{n} + \left(\frac{X^A_{1,n}}{n}\right)^2 \right] &-& \nonumber \\ - \sum_{i=1}^{m} \left[(x_i^{B})^2 - 2 x_i^{B}\frac{X^B_{1,m}}{m} + \left(\frac{X^B_{1,m}}{m}\right)^2 \right] &=& \Delta\sigma\end{aligned} +.. math:: \begin{aligned} + \sum_{i=1}^{n+m} \left[(x_i^{AB})^2 - 2 x_i^{AB}\frac{X^{AB}_{1,n+m}}{n+m} + \left(\frac{X^{AB}_{1,n+m}}{n+m}\right)^2 \right] &-& \nonumber \\ + \sum_{i=1}^{n} \left[(x_i^{A})^2 - 2 x_i^{A}\frac{X^A_{1,n}}{n} + \left(\frac{X^A_{1,n}}{n}\right)^2 \right] &-& \nonumber \\ + \sum_{i=1}^{m} \left[(x_i^{B})^2 - 2 x_i^{B}\frac{X^B_{1,m}}{m} + \left(\frac{X^B_{1,m}}{m}\right)^2 \right] &=& \Delta\sigma\end{aligned} + :label: eqnpscombresult2 all the :math:`x_i^2` terms drop out, and the terms independent of the summation counter :math:`i` can be simplified: -.. math:: - - \begin{aligned} - \frac{\left(X^{AB}_{1,n+m}\right)^2}{n+m} \,-\, - \frac{\left(X^A_{1,n}\right)^2}{n} \,-\, - \frac{\left(X^B_{1,m}\right)^2}{m} &-& \nonumber \\ - 2\,\frac{X^{AB}_{1,n+m}}{n+m}\sum_{i=1}^{n+m}x_i^{AB} \,+\, - 2\,\frac{X^{A}_{1,n}}{n}\sum_{i=1}^{n}x_i^{A} \,+\, - 2\,\frac{X^{B}_{1,m}}{m}\sum_{i=1}^{m}x_i^{B} &=& \Delta\sigma\end{aligned} +.. math:: \begin{aligned} + \frac{\left(X^{AB}_{1,n+m}\right)^2}{n+m} \,-\, + \frac{\left(X^A_{1,n}\right)^2}{n} \,-\, + \frac{\left(X^B_{1,m}\right)^2}{m} &-& \nonumber \\ + 2\,\frac{X^{AB}_{1,n+m}}{n+m}\sum_{i=1}^{n+m}x_i^{AB} \,+\, + 2\,\frac{X^{A}_{1,n}}{n}\sum_{i=1}^{n}x_i^{A} \,+\, + 2\,\frac{X^{B}_{1,m}}{m}\sum_{i=1}^{m}x_i^{B} &=& \Delta\sigma\end{aligned} + :label: eqnpscombsimp we recognize the three partial sums on the second line and use :eq:`eqn. %s ` to obtain: .. math:: \Delta\sigma ~=~ \frac{\left(mX^A_{1,n} - nX^B_{1,m}\right)^2}{nm(n+m)} + :label: eqnpscombused if we check this by inserting :math:`m=1` we get back :eq:`eqn. %s ` @@ -225,6 +225,7 @@ that the fluctuation in potential and kinetic energy should cancel. Nevertheless we can try the same approach as before by writing: .. math:: \sigma_{m,n}^S ~=~ \sum_{s=1}^S \sigma_{m,n}^s + \Delta\sigma + :label: eqnsigmatermsfluct if we fill in :eq:`eqn. %s `: @@ -234,40 +235,43 @@ if we fill in :eq:`eqn. %s `: which we can expand to: -.. math:: - - \begin{aligned} - &~&\sum_{i=m}^n \left[\sum_{s=1}^S (x_i^s)^2 + \left(\frac{X_{m,n}^S}{m-n+1}\right)^2 -2\left(\frac{X_{m,n}^S}{m-n+1}\sum_{s=1}^S x_i^s + \sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'} \right)\right] \nonumber \\ - &-&\sum_{s=1}^S \sum_{i=m}^n \left[(x_i^s)^2 - 2\,\frac{X_{m,n}^s}{m-n+1}\,x_i^s + \left(\frac{X_{m,n}^s}{m-n+1}\right)^2\right] ~=~\Delta\sigma \end{aligned} +.. math:: \begin{aligned} + &~&\sum_{i=m}^n \left[\sum_{s=1}^S (x_i^s)^2 + \left(\frac{X_{m,n}^S}{m-n+1}\right)^2 -2\left(\frac{X_{m,n}^S}{m-n+1}\sum_{s=1}^S x_i^s + \sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'} \right)\right] \nonumber \\ + &-&\sum_{s=1}^S \sum_{i=m}^n \left[(x_i^s)^2 - 2\,\frac{X_{m,n}^s}{m-n+1}\,x_i^s + \left(\frac{X_{m,n}^s}{m-n+1}\right)^2\right] ~=~\Delta\sigma \end{aligned} + :label: eqnsimtermsexpanded the terms with :math:`(x_i^s)^2` cancel, so that we can simplify to: -.. math:: - - \begin{aligned} - &~&\frac{\left(X_{m,n}^S\right)^2}{m-n+1} -2 \frac{X_{m,n}^S}{m-n+1}\sum_{i=m}^n\sum_{s=1}^S x_i^s -2\sum_{i=m}^n\sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'}\, - \nonumber \\ - &~&\sum_{s=1}^S \sum_{i=m}^n \left[- 2\,\frac{X_{m,n}^s}{m-n+1}\,x_i^s + \left(\frac{X_{m,n}^s}{m-n+1}\right)^2\right] ~=~\Delta\sigma \end{aligned} +.. math:: \begin{aligned} + &~&\frac{\left(X_{m,n}^S\right)^2}{m-n+1} -2 \frac{X_{m,n}^S}{m-n+1}\sum_{i=m}^n\sum_{s=1}^S x_i^s -2\sum_{i=m}^n\sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'}\, - \nonumber \\ + &~&\sum_{s=1}^S \sum_{i=m}^n \left[- 2\,\frac{X_{m,n}^s}{m-n+1}\,x_i^s + \left(\frac{X_{m,n}^s}{m-n+1}\right)^2\right] ~=~\Delta\sigma \end{aligned} + :label: eqnsigmatermssimplefied or .. math:: -\frac{\left(X_{m,n}^S\right)^2}{m-n+1} -2\sum_{i=m}^n\sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'}\, + \sum_{s=1}^S \frac{\left(X_{m,n}^s\right)^2}{m-n+1} ~=~\Delta\sigma + :label: eqnsigmatermsalternative If we now expand the first term using :eq:`eqn. %s ` we obtain: .. math:: -\frac{\left(\sum_{s=1}^SX_{m,n}^s\right)^2}{m-n+1} -2\sum_{i=m}^n\sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'}\, + \sum_{s=1}^S \frac{\left(X_{m,n}^s\right)^2}{m-n+1} ~=~\Delta\sigma + :label: eqnsigmatermsfirstexpand which we can reformulate to: .. math:: -2\left[\sum_{s=1}^S \sum_{s'=s+1}^S X_{m,n}^s X_{m,n}^{s'}\,+\sum_{i=m}^n\sum_{s=1}^S \sum_{s'=s+1}^S x_i^s x_i^{s'}\right] ~=~\Delta\sigma + :label: eqnsigmatermsreformed or .. math:: -2\left[\sum_{s=1}^S X_{m,n}^s \sum_{s'=s+1}^S X_{m,n}^{s'}\,+\,\sum_{s=1}^S \sum_{i=m}^nx_i^s \sum_{s'=s+1}^S x_i^{s'}\right] ~=~\Delta\sigma + :label: eqnsigmatermsreformedalternative which gives .. math:: -2\sum_{s=1}^S \left[X_{m,n}^s \sum_{s'=s+1}^S \sum_{i=m}^n x_i^{s'}\,+\,\sum_{i=m}^n x_i^s \sum_{s'=s+1}^S x_i^{s'}\right] ~=~\Delta\sigma + :label: eqnsigmatermsfinal Since we need all data points :math:`i` to evaluate this, in general this is not possible. We can then make an estimate of diff --git a/docs/reference-manual/definitions.rst b/docs/reference-manual/definitions.rst index 32b90b8a78..dc2ee05ad6 100644 --- a/docs/reference-manual/definitions.rst +++ b/docs/reference-manual/definitions.rst @@ -28,16 +28,16 @@ We define the *lowercase* subscripts :math:`i`, :math:`j`, :math:`k` and :math:`l` to denote particles: :math:`\mathbf{r}_i` is the *position vector* of particle :math:`i`, and using this notation: -.. math:: - - \begin{aligned} - \mathbf{r}_{ij} = \mathbf{r}_j-\mathbf{r}_i\\ - r_{ij}= | \mathbf{r}_{ij} | \end{aligned} +.. math:: \begin{aligned} + \mathbf{r}_{ij} = \mathbf{r}_j-\mathbf{r}_i\\ + r_{ij}= | \mathbf{r}_{ij} | \end{aligned} + :label: eqnnotation The force on particle :math:`i` is denoted by :math:`\mathbf{F}_i` and .. math:: \mathbf{F}_{ij} = \mbox{force on $i$ exerted by $j$} + :label: eqbforcenotation MD units -------- @@ -140,6 +140,7 @@ The **electric conversion factor** It relates the mechanical quantities to the electrical quantities as in .. math:: V = f \frac{q^2}{r} \mbox{\ \ or\ \ } F = f \frac{q^2}{r^2} + :label: eqnelecconv Electric potentials :math:`\Phi` and electric fields :math:`\mathbf{E}` are intermediate quantities in the @@ -149,11 +150,10 @@ units. We strongly recommend following the usual practice of including the factor :math:`f` in expressions that evaluate :math:`\Phi` and :math:`\mathbf{E}`: -.. math:: - - \begin{aligned} - \Phi(\mathbf{r}) = f \sum_j \frac{q_j}{| \mathbf{r}-\mathbf{r}_j | } \\ - \mathbf{E}(\mathbf{r}) = f \sum_j q_j \frac{(\mathbf{r}-\mathbf{r}_j)}{| \mathbf{r}-\mathbf{r}_j| ^3}\end{aligned} +.. math:: \begin{aligned} + \Phi(\mathbf{r}) = f \sum_j \frac{q_j}{| \mathbf{r}-\mathbf{r}_j | } \\ + \mathbf{E}(\mathbf{r}) = f \sum_j q_j \frac{(\mathbf{r}-\mathbf{r}_j)}{| \mathbf{r}-\mathbf{r}_j| ^3}\end{aligned} + :label: eqnelecfacinclude With these definitions, :math:`q\Phi` is an energy and :math:`q\mathbf{E}` is a force. The units are those given @@ -221,11 +221,11 @@ reduced temperature. A |Gromacs| temperature :math:`T=1` means a reduced temperature of :math:`0.008\ldots` units; if a reduced temperature of 1 is required, the |Gromacs| temperature should be :math:`120.272\,36`. -In :numref:`Table %s ` -quantities are given for LJ +In :numref:`Table %s ` quantities are given for LJ potentials: .. math:: V_{LJ} = 4\epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} - \left(\frac{\sigma}{r}\right)^{6} \right] + :label: eqnbaseljpotentials .. _table-reduced: diff --git a/docs/reference-manual/details.rst b/docs/reference-manual/details.rst index 826018a074..d0b279199e 100644 --- a/docs/reference-manual/details.rst +++ b/docs/reference-manual/details.rst @@ -11,6 +11,7 @@ Single Sum Virial in |Gromacs| The virial :math:`\Xi` can be written in full tensor form as: .. math:: \Xi~=~-\frac{1}{2}~\sum_{i < j}^N~\mathbf{r}_ij\otimes\mathbf{F}_{ij} + :label: eqnvirialfulltensorform where :math:`\otimes` denotes the *direct product* of two vectors. [1]_ When this is computed in the inner loop of an MD program 9 @@ -26,6 +27,7 @@ In a system with periodic boundary conditions, the periodicity must be taken into account for the virial: .. math:: \Xi~=~-\frac{1}{2}~\sum_{i < j}^{N}~\mathbf{r}_{ij}^n\otimes\mathbf{F}_{ij} + :label: eqnvirialperiodicity where :math:`\mathbf{r}_{ij}^n` denotes the distance vector of the *nearest image* of atom :math:`i` from atom :math:`j`. In @@ -35,10 +37,12 @@ difference vector :math:`\mathbf{r}_{ij}^n` is thus equal to: .. math:: \mathbf{r}_{ij}^n~=~\mathbf{r}_i+\delta_i-\mathbf{r}_j + :label: eqnvirialdiffvector or in shorthand: .. math:: \mathbf{r}_{ij}^n~=~\mathbf{r}_i^n-\mathbf{r}_j + :label: eqnvirialdiffvecshort In a triclinic system, there are 27 possible images of :math:`i`; when a truncated octahedron is used, there are 15 possible images. @@ -82,24 +86,23 @@ to |Gromacs| that we take into account: Starting from the above definition of the virial, we then get -.. math:: - - \begin{aligned} - \Xi - &~=~&-{\frac{1}{2}}~\sum_{i < j}^{N}~{\mathbf r}^n_{ij} \otimes {\mathbf F}_{ij} \nonumber \\ - &~=~&-{\frac{1}{2}}~\sum_{i < j}^{N}~\left( {\mathbf r}_i + \delta_{ij} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{j=1}^{N}~\left( {\mathbf r}_i + \delta_{ij} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij,s} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{i=}^{N}~\sum_{s}~\sum_{j=1}^{N}~\left( \left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} -{\mathbf r}_j \otimes {\mathbf F}_{ij,s} \right) \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^N ~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^{N} {\mathbf r}_j \otimes {\mathbf F}_{ij,s} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^N ~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{i=1}^{N}~\sum_{j=1}^{N} {\mathbf r}_j \otimes {\mathbf F}_{ij} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes ~\sum_{j=1}^N {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{j=1}^N {\mathbf r}_j \otimes \sum_{i=1}^{N} {\mathbf F}_{ij} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes ~\sum_{j=1}^N {\mathbf F}_{ij,s} - {\frac{1}{4}}\sum_{j=1}^N {\mathbf r}_j \otimes \sum_{i=1}^{N} {\mathbf F}_{ji} \nonumber \\ - &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{i,s} - {\frac{1}{4}}\sum_{j=1}^N~{\mathbf r}_j \otimes {\mathbf F}_{j} \nonumber \\ - &~=~&-{\frac{1}{4}}~\left(\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} + \sum_{j=1}^N~{\mathbf r}_j \otimes {\mathbf F}_{j} \right) - {\frac{1}{4}}\sum_{s}~\sum_{i=1}^{N} \delta_{i,s} \otimes {\mathbf F}_{i,s} \nonumber \\ - &~=~&-{\frac{1}{2}}\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} -{\frac{1}{4}}\sum_{s}~\sum_{i=1}^{N}~\delta_{i,s} \otimes {\mathbf F}_{i,s} \nonumber \\ - &~=~&-{\frac{1}{2}}\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} -{\frac{1}{4}}\sum_{s}~\delta_{s} \otimes {\mathbf F}_{s} \nonumber \\ - &~=~&\Xi_0 + \Xi_1\end{aligned} +.. math:: \begin{aligned} + \Xi + &~=~&-{\frac{1}{2}}~\sum_{i < j}^{N}~{\mathbf r}^n_{ij} \otimes {\mathbf F}_{ij} \nonumber \\ + &~=~&-{\frac{1}{2}}~\sum_{i < j}^{N}~\left( {\mathbf r}_i + \delta_{ij} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{j=1}^{N}~\left( {\mathbf r}_i + \delta_{ij} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} - {\mathbf r}_j \right) \otimes {\mathbf F}_{ij,s} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{i=}^{N}~\sum_{s}~\sum_{j=1}^{N}~\left( \left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} -{\mathbf r}_j \otimes {\mathbf F}_{ij,s} \right) \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^N ~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^{N} {\mathbf r}_j \otimes {\mathbf F}_{ij,s} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{i=1}^{N}~\sum_{s}~\sum_{j=1}^N ~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{i=1}^{N}~\sum_{j=1}^{N} {\mathbf r}_j \otimes {\mathbf F}_{ij} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes ~\sum_{j=1}^N {\mathbf F}_{ij,s} + {\frac{1}{4}}\sum_{j=1}^N {\mathbf r}_j \otimes \sum_{i=1}^{N} {\mathbf F}_{ij} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes ~\sum_{j=1}^N {\mathbf F}_{ij,s} - {\frac{1}{4}}\sum_{j=1}^N {\mathbf r}_j \otimes \sum_{i=1}^{N} {\mathbf F}_{ji} \nonumber \\ + &~=~&-{\frac{1}{4}}~\sum_{s}~\sum_{i=1}^{N}~\left( {\mathbf r}_i + \delta_{i,s} \right) \otimes {\mathbf F}_{i,s} - {\frac{1}{4}}\sum_{j=1}^N~{\mathbf r}_j \otimes {\mathbf F}_{j} \nonumber \\ + &~=~&-{\frac{1}{4}}~\left(\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} + \sum_{j=1}^N~{\mathbf r}_j \otimes {\mathbf F}_{j} \right) - {\frac{1}{4}}\sum_{s}~\sum_{i=1}^{N} \delta_{i,s} \otimes {\mathbf F}_{i,s} \nonumber \\ + &~=~&-{\frac{1}{2}}\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} -{\frac{1}{4}}\sum_{s}~\sum_{i=1}^{N}~\delta_{i,s} \otimes {\mathbf F}_{i,s} \nonumber \\ + &~=~&-{\frac{1}{2}}\sum_{i=1}^{N}~{\mathbf r}_i \otimes {\mathbf F}_{i} -{\frac{1}{4}}\sum_{s}~\delta_{s} \otimes {\mathbf F}_{s} \nonumber \\ + &~=~&\Xi_0 + \Xi_1\end{aligned} + :label: eqnviriallong In the second-last stage, we have used the property that each shift vector itself does not depend on the coordinates of particle :math:`i`, @@ -107,16 +110,16 @@ so it is possible to sum up all forces corresponding to each shift vector (in the nonbonded kernels), and then just use a sum over the different shift vectors outside the kernels. We have also used -.. math:: - - \begin{aligned} - \mathbf{F}_i&~=~&\sum_{j=1}^N~\mathbf{F}_{ij} \\ - \mathbf{F}_j&~=~&\sum_{i=1}^N~\mathbf{F}_{ji}\end{aligned} +.. math:: \begin{aligned} + \mathbf{F}_i&~=~&\sum_{j=1}^N~\mathbf{F}_{ij} \\ + \mathbf{F}_j&~=~&\sum_{i=1}^N~\mathbf{F}_{ji}\end{aligned} + :label: eqnvirialtotalforce which is the total force on :math:`i` with respect to :math:`j`. Because we use Newton’s Third Law: .. math:: \mathbf{F}_{ij}~=~-\mathbf{F}_{ji} + :label: eqnnewtonsthird we must, in the implementation, double the term containing the shift :math:`\delta_i`. Similarly, in a few places we have summed the @@ -173,22 +176,20 @@ Virial from Covalent Bonds Since the covalent bond force gives a contribution to the virial, we have: -.. math:: - - \begin{aligned} - b &~=~& \|\mathbf{r}_{ij}^n\| \\ - V_b &~=~& \frac{1}{2} k_b(b-b_0)^2 \\ - \mathbf{F}_i &~=~& -\nabla V_b \\ - &~=~& k_b(b-b_0)\frac{\mathbf{r}_{ij}^n}{b} \\ - \mathbf{F}_j &~=~& -\mathbf{F}_i\end{aligned} +.. math:: \begin{aligned} + b &~=~& \|\mathbf{r}_{ij}^n\| \\ + V_b &~=~& \frac{1}{2} k_b(b-b_0)^2 \\ + \mathbf{F}_i &~=~& -\nabla V_b \\ + &~=~& k_b(b-b_0)\frac{\mathbf{r}_{ij}^n}{b} \\ + \mathbf{F}_j &~=~& -\mathbf{F}_i\end{aligned} + :label: eqncovbondvirial The virial contribution from the bonds then is: -.. math:: - - \begin{aligned} - \Xi_b &~=~& -\frac{1}{2}(\mathbf{r}_i^n\otimes\mathbf{F}_i~+~\mathbf{r}_j\otimes\mathbf{F}_j) \\ - &~=~& -\frac{1}{2}\mathbf{r}_{ij}^n\otimes\mathbf{F}_i\end{aligned} +.. math:: \begin{aligned} + \Xi_b &~=~& -\frac{1}{2}(\mathbf{r}_i^n\otimes\mathbf{F}_i~+~\mathbf{r}_j\otimes\mathbf{F}_j) \\ + &~=~& -\frac{1}{2}\mathbf{r}_{ij}^n\otimes\mathbf{F}_i\end{aligned} + :label: eqncovbondvirialcontri Virial from SHAKE ~~~~~~~~~~~~~~~~~ @@ -198,12 +199,11 @@ constraints a force **G** that is exerted on the particles “shaken.” If this force does not come out of the algorithm (as in standard SHAKE) it can be calculated afterward (when using *leap-frog*) by: -.. math:: - - \begin{aligned} - \Delta\mathbf{r}_i&~=~&{\mathbf{r}_i}(t+{\Delta t})- - [\mathbf{r}_i(t)+{\bf v}_i(t-\frac{{\Delta t}}{2}){\Delta t}+\frac{\mathbf{F}_i}{m_i}{\Delta t}^2] \\ - {\bf G}_i&~=~&\frac{m_i{\Delta}{\mathbf{r}_i}}{{\Delta t}^2i}\end{aligned} +.. math:: \begin{aligned} + \Delta\mathbf{r}_i&~=~&{\mathbf{r}_i}(t+{\Delta t})- + [\mathbf{r}_i(t)+{\bf v}_i(t-\frac{{\Delta t}}{2}){\Delta t}+\frac{\mathbf{F}_i}{m_i}{\Delta t}^2] \\ + {\bf G}_i&~=~&\frac{m_i{\Delta}{\mathbf{r}_i}}{{\Delta t}^2i}\end{aligned} + :label: eqnshakevirial This does not help us in the general case. Only when no periodicity is needed (like in rigid water) this can be used, otherwise we must add the @@ -213,6 +213,7 @@ When it *is* applicable the virial can be calculated in the single sum way: .. math:: \Xi~=~-\frac{1}{2}\sum_i^{N_c}~\mathbf{r}_i\otimes\mathbf{F}_i + :label: eqnshakevirialsinglesum where :math:`N_c` is the number of constrained atoms. diff --git a/docs/reference-manual/functions/bonded-interactions.rst b/docs/reference-manual/functions/bonded-interactions.rst index a556ebbf2e..4579b083f8 100644 --- a/docs/reference-manual/functions/bonded-interactions.rst +++ b/docs/reference-manual/functions/bonded-interactions.rst @@ -31,10 +31,12 @@ The bond stretching between two covalently bonded atoms :math:`i` and potential (right). .. math:: V_b~({r_{ij}}) = {\frac{1}{2}}k^b_{ij}({r_{ij}}-b_{ij})^2 + :label: eqnharmbondstretch See also :numref:`Fig. %s `, with the force given by: .. math:: \mathbf{F}_i(\mathbf{r}_ij) = k^b_{ij}({r_{ij}}-b_{ij}) {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} + :label: eqnharmbondstretchforce .. _g96bond: @@ -45,16 +47,19 @@ In the GROMOS-96 force field \ :ref:`77 `, the covalent bond potential is, for reasons of computational efficiency, written as: .. math:: V_b~({r_{ij}}) = \frac{1}{4}k^b_{ij}\left({r_{ij}}^2-b_{ij}^2\right)^2 + :label: eqng96bond The corresponding force is: .. math:: \mathbf{F}_i(\mathbf{r}_ij) = k^b_{ij}({r_{ij}}^2-b_{ij}^2)~\mathbf{r}_ij + :label: eqng96bondforce The force constants for this form of the potential are related to the usual harmonic force constant :math:`k^{b,\mathrm{harm}}` (sec. :ref:`bondpot`) as .. math:: 2 k^b b_{ij}^2 = k^{b,\mathrm{harm}} + :label: eqn96harmrelation The force constants are mostly derived from the harmonic ones used in GROMOS-87 :ref:`78 `. Although this form is @@ -76,15 +81,15 @@ in that it has an asymmetric potential well and a zero force at infinite distance. The functional form is: .. math:: \displaystyle V_{morse} (r_{ij}) = D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2, + :label: eqnmorsebond See also :numref:`Fig. %s `, and the corresponding force is: -.. math:: - - \begin{array}{rcl} - \displaystyle {\bf F}_{morse} ({\bf r}_{ij})&=&2 D_{ij} \beta_{ij} \exp(-\beta_{ij}(r_{ij}-b_{ij})) * \\ - \displaystyle \: & \: &[1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))] \frac{\displaystyle {\bf r}_{ij}}{\displaystyle r_{ij}}, - \end{array} +.. math:: \begin{array}{rcl} + \displaystyle {\bf F}_{morse} ({\bf r}_{ij})&=&2 D_{ij} \beta_{ij} \exp(-\beta_{ij}(r_{ij}-b_{ij})) * \\ + \displaystyle \: & \: &[1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))] \frac{\displaystyle {\bf r}_{ij}}{\displaystyle r_{ij}}, + \end{array} + :label: eqnmorsebondforce where :math:`\displaystyle D_{ij}` is the depth of the well in kJ/mol, :math:`\displaystyle \beta_{ij}` defines the steepness of the @@ -94,6 +99,7 @@ equilibrium distance in nm. The steepness parameter *j*, the fundamental vibration frequency :math:`\displaystyle\omega_{ij}` and the well depth :math:`\displaystyle D_{ij}`: .. math:: \displaystyle \beta_{ij}= \omega_{ij} \sqrt{\frac{\mu_{ij}}{2 D_{ij}}} + :label: eqnmorsefreq and because :math:`\displaystyle \omega = \sqrt{k/\mu}`, one can rewrite :math:`\displaystyle \beta_{ij}` in terms of the harmonic @@ -112,13 +118,12 @@ Taylor expansion: and substituting :eq:`eqn. %s ` and :eq:`eqn. %s ` in the functional form: -.. math:: - - \begin{array}{rcl} - \displaystyle V_{morse} (r_{ij})&=&D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2\\ - \displaystyle \:&=&D_{ij} [1 - (1 -\sqrt{\frac{k_{ij}}{2 D_{ij}}}(r_{ij}-b_{ij}))]^2\\ - \displaystyle \:&=&\frac{1}{2} k_{ij} (r_{ij}-b_{ij}))^2 - \end{array} +.. math:: \begin{array}{rcl} + \displaystyle V_{morse} (r_{ij})&=&D_{ij} [1 - \exp(-\beta_{ij}(r_{ij}-b_{ij}))]^2\\ + \displaystyle \:&=&D_{ij} [1 - (1 -\sqrt{\frac{k_{ij}}{2 D_{ij}}}(r_{ij}-b_{ij}))]^2\\ + \displaystyle \:&=&\frac{1}{2} k_{ij} (r_{ij}-b_{ij}))^2 + \end{array} + :label: eqnharmfrommorse we recover the harmonic bond stretching potential. @@ -137,6 +142,7 @@ than the Morse potential adds a cubic term in the distance to the simple harmonic form: .. math:: V_b~({r_{ij}}) = k^b_{ij}({r_{ij}}-b_{ij})^2 + k^b_{ij}k^{cub}_{ij}({r_{ij}}-b_{ij})^3 + :label: eqncubicbond A flexible water model (based on the SPC water model \ :ref:`80 `) including a cubic bond stretching potential for the O-H bond was @@ -149,6 +155,7 @@ energies. The integration timestep is therefore limited to 1 fs. The force corresponding to this potential is: .. math:: \mathbf{F}_i(\mathbf{r}_ij) = 2k^b_{ij}({r_{ij}}-b_{ij})~{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}}+ 3k^b_{ij}k^{cub}_{ij}({r_{ij}}-b_{ij})^2~{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} + :label: eqncubicbondforce FENE bond stretching potential ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -156,18 +163,16 @@ FENE bond stretching potential In coarse-grained polymer simulations the beads are often connected by a FENE (finitely extensible nonlinear elastic) potential \ :ref:`82 `: -.. math:: - - V_{\mbox{\small FENE}}({r_{ij}}) = - -{\frac{1}{2}}k^b_{ij} b^2_{ij} \log\left(1 - \frac{{r_{ij}}^2}{b^2_{ij}}\right) +.. math:: V_{\mbox{FENE}}({r_{ij}}) = + -{\frac{1}{2}}k^b_{ij} b^2_{ij} \log\left(1 - \frac{{r_{ij}}^2}{b^2_{ij}}\right) + :label: eqnfenebond The potential looks complicated, but the expression for the force is simpler: -.. math:: - - F_{\mbox{\small FENE}}(\mathbf{r}_ij) = - -k^b_{ij} \left(1 - \frac{{r_{ij}}^2}{b^2_{ij}}\right)^{-1} \mathbf{r}_ij +.. math:: F_{\mbox{FENE}}(\mathbf{r}_ij) = + -k^b_{ij} \left(1 - \frac{{r_{ij}}^2}{b^2_{ij}}\right)^{-1} \mathbf{r}_ij + :label: eqnfenebondforce At short distances the potential asymptotically goes to a harmonic potential with force constant :math:`k^b`, while it diverges at distance @@ -187,10 +192,10 @@ angle :math:`{\theta_{ijk}}` .. figure:: plots/angle.* :width: 7.00000cm - Principle of angle vibration (left) and the bond angle potential - (right). + Principle of angle vibration (left) and the bond angle potential. .. math:: V_a({\theta_{ijk}}) = {\frac{1}{2}}k^{\theta}_{ijk}({\theta_{ijk}}-{\theta_{ijk}}^0)^2 + :label: eqnharmangle As the bond-angle vibration is represented by a harmonic potential, the form is the same as the bond stretching @@ -198,15 +203,14 @@ form is the same as the bond stretching The force equations are given by the chain rule: -.. math:: - - \begin{array}{l} - \mathbf{F}_i ~=~ -\displaystyle\frac{d V_a({\theta_{ijk}})}{d \mathbf{r}_i} \\ - \mathbf{F}_k ~=~ -\displaystyle\frac{d V_a({\theta_{ijk}})}{d \mathbf{r}_k} \\ - \mathbf{F}_j ~=~ -\mathbf{F}_i-\mathbf{F}_k - \end{array} - ~ \mbox{ ~ where ~ } ~ - {\theta_{ijk}}= \arccos \frac{(\mathbf{r}_ij \cdot \mathbf{r}_{kj})}{r_{ij}r_{kj}} +.. math:: \begin{array}{l} + \mathbf{F}_i ~=~ -\displaystyle\frac{d V_a({\theta_{ijk}})}{d \mathbf{r}_i} \\ + \mathbf{F}_k ~=~ -\displaystyle\frac{d V_a({\theta_{ijk}})}{d \mathbf{r}_k} \\ + \mathbf{F}_j ~=~ -\mathbf{F}_i-\mathbf{F}_k + \end{array} + ~ \mbox{ ~ where ~ } ~ + {\theta_{ijk}}= \arccos \frac{(\mathbf{r}_ij \cdot \mathbf{r}_{kj})}{r_{ij}r_{kj}} + :label: eqnharmangleforce The numbering :math:`i,j,k` is in sequence of covalently bonded atoms. Atom :math:`j` is in the middle; atoms :math:`i` and :math:`k` are at @@ -223,11 +227,12 @@ In the GROMOS-96 force field a simplified function is used to represent angle vibrations: .. math:: V_a({\theta_{ijk}}) = {\frac{1}{2}}k^{\theta}_{ijk}\left(\cos({\theta_{ijk}}) - \cos({\theta_{ijk}}^0)\right)^2 - :label: eqG96angle + :label: eqnG96angle where .. math:: \cos({\theta_{ijk}}) = \frac{\mathbf{r}_ij\cdot\mathbf{r}_{kj}}{{r_{ij}}r_{kj}} + :label: eqnG96anglecos The corresponding force can be derived by partial differentiation with respect to the atomic positions. The force constants in this function @@ -235,6 +240,7 @@ are related to the force constants in the harmonic form :math:`k^{\theta,\mathrm{harm}}` (:ref:`harmonicangle`) by: .. math:: k^{\theta} \sin^2({\theta_{ijk}}^0) = k^{\theta,\mathrm{harm}} + :label: eqnG96angleFC In the GROMOS-96 manual there is a much more complicated conversion formula which is temperature dependent. The formulas are equivalent at 0 @@ -254,14 +260,14 @@ of the torsion angle and potential are eliminated when performing coarse-grained molecular dynamics simulations. To systematically hinder the bending angles from reaching the -:math:`180^{\circ}` value, the bending potential :eq:`eqn %s ` is +:math:`180^{\circ}` value, the bending potential :eq:`eqn %s ` is divided by a :math:`\sin^2\theta` factor: .. math:: V_{\rm ReB}(\theta_i) = \frac{1}{2} k_{\theta} \frac{(\cos\theta_i - \cos\theta_0)^2}{\sin^2\theta_i}. - :label: eqReB + :label: eqnReB :numref:`Figure %s ` shows the comparison between the ReB potential, -:eq:`%s `, and the standard one :eq:`%s `. +:eq:`%s `, and the standard one :eq:`%s `. .. _fig-ReB: @@ -312,6 +318,7 @@ separate energy term. It is used mainly in the CHARMm force field \ :ref:`84 `. The energy is given by: .. math:: V_a({\theta_{ijk}}) = {\frac{1}{2}}k^{\theta}_{ijk}({\theta_{ijk}}-{\theta_{ijk}}^0)^2 + {\frac{1}{2}}k^{UB}_{ijk}(r_{ik}-r_{ik}^0)^2 + :label: eqnUBAngle The force equations can be deduced from sections :ref:`harmonicbond` and :ref:`harmonicangle`. @@ -332,6 +339,7 @@ where :math:`k_{rr'}` is the force constant, and :math:`r_{1e}` and on particle :math:`i` is: .. math:: \mathbf{F}_{i} = -k_{rr'}\left(\left|\mathbf{r}_{k}-\mathbf{r}_j\right|-r_{2e}\right)\frac{\mathbf{r}_i-\mathbf{r}_j}{\left|\mathbf{r}_{i}-\mathbf{r}_j\right|} + :label: eqncrossbbforce The force on atom :math:`k` can be obtained by swapping :math:`i` and :math:`k` in the above equation. Finally, the force on atom :math:`j` @@ -346,33 +354,33 @@ bonds :math:`i-j` and :math:`k-j` is given by \ :ref:`85 `: .. math:: V_{r\theta} ~=~ k_{r\theta} \left(\left|\mathbf{r}_{i}-\mathbf{r}_k\right|-r_{3e} \right) \left(\left|\mathbf{r}_{i}-\mathbf{r}_j\right|-r_{1e} + \left|\mathbf{r}_{k}-\mathbf{r}_j\right|-r_{2e}\right) + :label: eqncrossba where :math:`k_{r\theta}` is the force constant, :math:`r_{3e}` is the :math:`i-k` distance, and the other constants are the same as in :eq:`Equation %s `. The force associated with the potential on atom :math:`i` is: -.. math:: - - \mathbf{F}_{i} ~=~ -k_{r\theta} - \left[ - \left( - \left| \mathbf{r}_{i} - \mathbf{r}_{k}\right| - -r_{3e}\right) - \frac{ - \mathbf{r}_{i}-\mathbf{r}_j} - { \left| \mathbf{r}_{i}-\mathbf{r}_{j}\right| - } - + \left( - \left| \mathbf{r}_{i}-\mathbf{r}_{j}\right| - -r_{1e} - + \left| \mathbf{r}_{k}-\mathbf{r}_{j}\right| - -r_{2e}\right) - \frac{ - \mathbf{r}_{i}-\mathbf{r}_{k}} - {\left| \mathbf{r}_{i}-\mathbf{r}_{k}\right| - } - \right] +.. math:: \mathbf{F}_{i} ~=~ -k_{r\theta} + \left[ + \left( + \left| \mathbf{r}_{i} - \mathbf{r}_{k}\right| + -r_{3e}\right) + \frac{ + \mathbf{r}_{i}-\mathbf{r}_j} + { \left| \mathbf{r}_{i}-\mathbf{r}_{j}\right| + } + + \left( + \left| \mathbf{r}_{i}-\mathbf{r}_{j}\right| + -r_{1e} + + \left| \mathbf{r}_{k}-\mathbf{r}_{j}\right| + -r_{2e}\right) + \frac{ + \mathbf{r}_{i}-\mathbf{r}_{k}} + {\left| \mathbf{r}_{i}-\mathbf{r}_{k}\right| + } + \right] + :label: eqncrossbaforce Quartic angle potential ~~~~~~~~~~~~~~~~~~~~~~~ @@ -381,6 +389,7 @@ For special purposes there is an angle potential that uses a fourth order polynomial: .. math:: V_q({\theta_{ijk}}) ~=~ \sum_{n=0}^5 C_n ({\theta_{ijk}}-{\theta_{ijk}}^0)^n + :label: eqnquarticangle .. _imp: @@ -417,6 +426,7 @@ The simplest improper dihedral potential is a harmonic potential; it is plotted in :numref:`Fig. %s `. .. math:: V_{id}(\xi_{ijkl}) = {\frac{1}{2}}k_{\xi}(\xi_{ijkl}-\xi_0)^2 + :label: eqnharmimpdihedral Since the potential is harmonic it is discontinuous, but since the discontinuity is chosen at 180\ :math:`^\circ` distance from @@ -478,6 +488,7 @@ section. dihedral angle potential (right). .. math:: V_d(\phi_{ijkl}) = k_{\phi}(1 + \cos(n \phi - \phi_s)) + :label: eqnperiodicpropdihedral Proper dihedrals: Ryckaert-Bellemans function ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -486,6 +497,7 @@ Proper dihedrals: Ryckaert-Bellemans function (see :numref:`Fig. %s `): .. math:: V_{rb}(\phi_{ijkl}) = \sum_{n=0}^5 C_n( \cos(\psi ))^n, + :label: eqnRBproperdihedral | where :math:`\psi = \phi - 180^\circ`. | **Note:** A conversion from one convention to another can be achieved @@ -523,10 +535,9 @@ interactions between the first and the last atom of the dihedral, and | The RB dihedral function can also be used to include Fourier dihedrals (see below): - .. math:: - - V_{rb} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[F_1(1+\cos(\phi)) + F_2( - 1-\cos(2\phi)) + F_3(1+\cos(3\phi)) + F_4(1-\cos(4\phi))\right] + .. math:: V_{rb} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[F_1(1+\cos(\phi)) + F_2( + 1-\cos(2\phi)) + F_3(1+\cos(3\phi)) + F_4(1-\cos(4\phi))\right] + :label: eqnRBproperdihedralFourier | Because of the equalities :math:`\cos(2\phi) = 2\cos^2(\phi) - 1`, :math:`\cos(3\phi) = 4\cos^3(\phi) - 3\cos(\phi)` and @@ -534,17 +545,16 @@ interactions between the first and the last atom of the dihedral, and translate the OPLS parameters to Ryckaert-Bellemans parameters as follows: - .. math:: - - \displaystyle - \begin{array}{rcl} - \displaystyle C_0&=&F_2 + \frac{1}{2} (F_1 + F_3)\\ - \displaystyle C_1&=&\frac{1}{2} (- F_1 + 3 \, F_3)\\ - \displaystyle C_2&=& -F_2 + 4 \, F_4\\ - \displaystyle C_3&=&-2 \, F_3\\ - \displaystyle C_4&=&-4 \, F_4\\ - \displaystyle C_5&=&0 - \end{array} + .. math:: \displaystyle + \begin{array}{rcl} + \displaystyle C_0&=&F_2 + \frac{1}{2} (F_1 + F_3)\\ + \displaystyle C_1&=&\frac{1}{2} (- F_1 + 3 \, F_3)\\ + \displaystyle C_2&=& -F_2 + 4 \, F_4\\ + \displaystyle C_3&=&-2 \, F_3\\ + \displaystyle C_4&=&-4 \, F_4\\ + \displaystyle C_5&=&0 + \end{array} + :label: eqnoplsRBconversion | with OPLS parameters in protein convention and RB parameters in polymer convention (this yields a minus sign for the odd powers of @@ -561,10 +571,9 @@ Proper dihedrals: Fourier function cosine terms of a Fourier series. In |Gromacs| the four term function is implemented: - .. math:: - - V_{F} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[C_1(1+\cos(\phi)) + C_2( - 1-\cos(2\phi)) + C_3(1+\cos(3\phi)) + C_4(1-\cos(4\phi))\right], + .. math:: V_{F} (\phi_{ijkl}) ~=~ \frac{1}{2} \left[C_1(1+\cos(\phi)) + C_2( + 1-\cos(2\phi)) + C_3(1+\cos(3\phi)) + C_4(1-\cos(4\phi))\right], + :label: eqnfourierproperdihedral | Internally, |Gromacs| uses the Ryckaert-Bellemans code to compute Fourier dihedrals (see above), because this is more efficient. @@ -578,7 +587,7 @@ In a manner very similar to the restricted bending potential (see :ref:`ReB`), a restricted torsion/dihedral potential is introduced: .. math:: V_{\rm ReT}(\phi_i) = \frac{1}{2} k_{\phi} \frac{(\cos\phi_i - \cos\phi_0)^2}{\sin^2\phi_i} - :label: eqReT + :label: eqnReT with the advantages of being a function of :math:`\cos\phi` (no problems taking the derivative of :math:`\sin\phi`) and of keeping the @@ -610,7 +619,7 @@ cosine form) with the bending potentials of the adjacent bending angles in a unique expression: .. math:: V_{\rm CBT}(\theta_{i-1}, \theta_i, \phi_i) = k_{\phi} \sin^3\theta_{i-1} \sin^3\theta_{i} \sum_{n=0}^4 { a_n \cos^n\phi_i}. - :label: eqCBT + :label: eqnCBT This combined bending-torsion (CBT) potential has been proposed by \ :ref:`88 ` for polymer melt simulations and is @@ -650,7 +659,7 @@ curves, respectively). :width: 10.00000cm Blue: surface plot of the combined bending-torsion potential - (:eq:`%s ` with :math:`k = 10` kJ mol\ :math:`^{-1}`, + (:eq:`%s ` with :math:`k = 10` kJ mol\ :math:`^{-1}`, :math:`a_0=2.41`, :math:`a_1=-2.95`, :math:`a_2=0.36`, :math:`a_3=1.33`) when, for simplicity, the bending angles behave the same (:math:`\theta_1=\theta_2=\theta`). Gray: the same torsion @@ -663,7 +672,7 @@ Cartesian variables is straightforward: .. math:: \frac{\partial V_{\rm CBT}(\theta_{i-1},\theta_i,\phi_i)} {\partial \vec r_{l}} = \frac{\partial V_{\rm CBT}}{\partial \theta_{i-1}} \frac{\partial \theta_{i-1}}{\partial \vec r_{l}} + \frac{\partial V_{\rm CBT}}{\partial \theta_{i }} \frac{\partial \theta_{i }}{\partial \vec r_{l}} + \frac{\partial V_{\rm CBT}}{\partial \phi_{i }} \frac{\partial \phi_{i }}{\partial \vec r_{l}} - :label: eqforcecbt + :label: eqnforcecbt The CBT is based on a cosine form without multiplicity, so it can only be symmetrical around :math:`0^{\circ}`. To obtain an asymmetrical @@ -689,12 +698,11 @@ Tabulated bonded interaction functions angles and dihedrals through user-supplied tabulated functions. The functional shapes are: - .. math:: - - \begin{aligned} - V_b(r_{ij}) &=& k \, f^b_n(r_{ij}) \\ - V_a({\theta_{ijk}}) &=& k \, f^a_n({\theta_{ijk}}) \\ - V_d(\phi_{ijkl}) &=& k \, f^d_n(\phi_{ijkl})\end{aligned} + .. math:: \begin{aligned} + V_b(r_{ij}) &=& k \, f^b_n(r_{ij}) \\ + V_a({\theta_{ijk}}) &=& k \, f^a_n({\theta_{ijk}}) \\ + V_d(\phi_{ijkl}) &=& k \, f^d_n(\phi_{ijkl})\end{aligned} + :label: eqntabuöatedbond | where :math:`k` is a force constant in units of energy and :math:`f` is a cubic spline function; for details see :ref:`cubicspline`. For diff --git a/docs/reference-manual/functions/free-energy-interactions.rst b/docs/reference-manual/functions/free-energy-interactions.rst index 6fd043c49c..1d48ce7c0d 100644 --- a/docs/reference-manual/functions/free-energy-interactions.rst +++ b/docs/reference-manual/functions/free-energy-interactions.rst @@ -24,16 +24,15 @@ The example given here is for the bond potential, which is harmonic in |Gromacs|. However, these equations apply to the angle potential and the improper dihedral potential as well. -.. math:: - - \begin{aligned} - V_b &=&{\frac{1}{2}}\left[{(1-{\lambda})}k_b^A + - {\lambda}k_b^B\right] \left[b - {(1-{\lambda})}b_0^A - {\lambda}b_0^B\right]^2 \\ - {\frac{\partial V_b}{\partial {\lambda}}}&=&{\frac{1}{2}}(k_b^B-k_b^A) - \left[b - {(1-{\lambda})}b_0^A + {\lambda}b_0^B\right]^2 + - \nonumber\\ - & & \phantom{{\frac{1}{2}}}(b_0^A-b_0^B) \left[b - {(1-{\lambda})}b_0^A -{\lambda}b_0^B\right] - \left[{(1-{\lambda})}k_b^A + {\lambda}k_b^B \right]\end{aligned} +.. math:: \begin{aligned} + V_b &=&{\frac{1}{2}}\left[{(1-{\lambda})}k_b^A + + {\lambda}k_b^B\right] \left[b - {(1-{\lambda})}b_0^A - {\lambda}b_0^B\right]^2 \\ + {\frac{\partial V_b}{\partial {\lambda}}}&=&{\frac{1}{2}}(k_b^B-k_b^A) + \left[b - {(1-{\lambda})}b_0^A + {\lambda}b_0^B\right]^2 + + \nonumber\\ + & & \phantom{{\frac{1}{2}}}(b_0^A-b_0^B) \left[b - {(1-{\lambda})}b_0^A -{\lambda}b_0^B\right] + \left[{(1-{\lambda})}k_b^A + {\lambda}k_b^B \right]\end{aligned} + :label: eqnfepharmpot GROMOS-96 bonds and angles ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -47,22 +46,21 @@ Proper dihedrals For the proper dihedrals, the equations are somewhat more complicated: -.. math:: - - \begin{aligned} - V_d &=&\left[{(1-{\lambda})}k_d^A + {\lambda}k_d^B \right] - \left( 1+ \cos\left[n_{\phi} \phi - - {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B - \right]\right)\\ - {\frac{\partial V_d}{\partial {\lambda}}}&=&(k_d^B-k_d^A) - \left( 1+ \cos - \left[ - n_{\phi} \phi- {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B - \right] - \right) + - \nonumber\\ - &&(\phi_s^B - \phi_s^A) \left[{(1-{\lambda})}k_d^A - {\lambda}k_d^B\right] - \sin\left[ n_{\phi}\phi - {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B \right]\end{aligned} +.. math:: \begin{aligned} + V_d &=&\left[{(1-{\lambda})}k_d^A + {\lambda}k_d^B \right] + \left( 1+ \cos\left[n_{\phi} \phi - + {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B + \right]\right)\\ + {\frac{\partial V_d}{\partial {\lambda}}}&=&(k_d^B-k_d^A) + \left( 1+ \cos + \left[ + n_{\phi} \phi- {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B + \right] + \right) + + \nonumber\\ + &&(\phi_s^B - \phi_s^A) \left[{(1-{\lambda})}k_d^A - {\lambda}k_d^B\right] + \sin\left[ n_{\phi}\phi - {(1-{\lambda})}\phi_s^A - {\lambda}\phi_s^B \right]\end{aligned} + :label: eqnfeppropdihedral **Note:** that the multiplicity :math:`n_{\phi}` can not be parameterized because the function should remain periodic on the @@ -74,11 +72,10 @@ Tabulated bonded interactions For tabulated bonded interactions only the force constant can interpolated: -.. math:: - - \begin{aligned} - V &=& ({(1-{\lambda})}k^A + {\lambda}k^B) \, f \\ - {\frac{\partial V}{\partial {\lambda}}} &=& (k^B - k^A) \, f\end{aligned} +.. math:: \begin{aligned} + V &=& ({(1-{\lambda})}k^A + {\lambda}k^B) \, f \\ + {\frac{\partial V}{\partial {\lambda}}} &=& (k^B - k^A) \, f\end{aligned} + :label: eqnfeptabbonded Coulomb interaction ~~~~~~~~~~~~~~~~~~~ @@ -86,11 +83,10 @@ Coulomb interaction The Coulomb interaction between two particles of which the charge varies with :math:`{\lambda}` is: -.. math:: - - \begin{aligned} - V_c &=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[{(1-{\lambda})}q_i^A q_j^A + {\lambda}\, q_i^B q_j^B\right] \\ - {\frac{\partial V_c}{\partial {\lambda}}}&=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[- q_i^A q_j^A + q_i^B q_j^B\right]\end{aligned} +.. math:: \begin{aligned} + V_c &=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[{(1-{\lambda})}q_i^A q_j^A + {\lambda}\, q_i^B q_j^B\right] \\ + {\frac{\partial V_c}{\partial {\lambda}}}&=& \frac{f}{{\varepsilon_{rf}}{r_{ij}}}\left[- q_i^A q_j^A + q_i^B q_j^B\right]\end{aligned} + :label: eqnfepcoloumb where :math:`f = \frac{1}{4\pi \varepsilon_0} = {138.935\,458}` (see chapter :ref:`defunits`). @@ -146,17 +142,16 @@ m :math:`\mathbf{v}`, since that would result in the sign of :math:`{\frac{\partial E_k}{\partial {\lambda}}}` being incorrect \ :ref:`99 `): -.. math:: - - \begin{aligned} - E_k &=& {\frac{1}{2}}\frac{\mathbf{p}^2}{{(1-{\lambda})}m^A + {\lambda}m^B} \\ - {\frac{\partial E_k}{\partial {\lambda}}}&=& -{\frac{1}{2}}\frac{\mathbf{p}^2(m^B-m^A)}{({(1-{\lambda})}m^A + {\lambda}m^B)^2}\end{aligned} +.. math:: \begin{aligned} + E_k &=& {\frac{1}{2}}\frac{\mathbf{p}^2}{{(1-{\lambda})}m^A + {\lambda}m^B} \\ + {\frac{\partial E_k}{\partial {\lambda}}}&=& -{\frac{1}{2}}\frac{\mathbf{p}^2(m^B-m^A)}{({(1-{\lambda})}m^A + {\lambda}m^B)^2}\end{aligned} + :label: eqnfepekin after taking the derivative, we *can* insert -:math:`\mathbf{p}` = -m :math:`\mathbf{v}`, such that: +:math:`\mathbf{p}` = m :math:`\mathbf{v}`, such that: .. math:: {\frac{\partial E_k}{\partial {\lambda}}}~=~ -{\frac{1}{2}}\mathbf{v}^2(m^B-m^A) + :label: eqnfepekinderivative Constraints ~~~~~~~~~~~ @@ -167,6 +162,7 @@ calculated using the LINCS or the SHAKE algorithm. If we have :math:`k = 1 \ldots K` constraint equations :math:`g_k` for LINCS, then .. math:: g_k = | \mathbf{r}_{k} | - d_{k} + :label: eqnfepconstr where :math:`\mathbf{r}_k` is the displacement vector between two particles and :math:`d_k` is the constraint distance between @@ -174,32 +170,33 @@ the two particles. We can express the fact that the constraint distance has a :math:`{\lambda}` dependency by .. math:: d_k = {(1-{\lambda})}d_{k}^A + {\lambda}d_k^B + :label: eqnfepconstrdistdep Thus the :math:`{\lambda}`-dependent constraint equation is .. math:: g_k = | \mathbf{r}_{k} | - \left({(1-{\lambda})}d_{k}^A + {\lambda}d_k^B\right). + :label: eqnfepconstrlambda The (zero) contribution :math:`G` to the Hamiltonian from the constraints (using Lagrange multipliers :math:`\lambda_k`, which are logically distinct from the free-energy :math:`{\lambda}`) is -.. math:: - - \begin{aligned} - G &=& \sum^K_k \lambda_k g_k \\ - {\frac{\partial G}{\partial {\lambda}}} &=& \frac{\partial G}{\partial d_k} {\frac{\partial d_k}{\partial {\lambda}}} \\ - &=& - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned} +.. math:: \begin{aligned} + G &=& \sum^K_k \lambda_k g_k \\ + {\frac{\partial G}{\partial {\lambda}}} &=& \frac{\partial G}{\partial d_k} {\frac{\partial d_k}{\partial {\lambda}}} \\ + &=& - \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned} + :label: eqnconstrfreeenergy For SHAKE, the constraint equations are .. math:: g_k = \mathbf{r}_{k}^2 - d_{k}^2 + :label: eqnfepshakeconstr with :math:`d_k` as before, so -.. math:: - - \begin{aligned} - {\frac{\partial G}{\partial {\lambda}}} &=& -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned} +.. math:: \begin{aligned} + {\frac{\partial G}{\partial {\lambda}}} &=& -2 \sum^K_k \lambda_k \left(d_k^B-d_k^A\right)\end{aligned} + :label: eqnfepshakeconstr2 Soft-core interactions ~~~~~~~~~~~~~~~~~~~~~~ @@ -234,14 +231,13 @@ In |Gromacs| the soft-core potentials :math:`V_{sc}` are shifted versions of the regular potentials, so that the singularity in the potential and its derivatives at :math:`r=0` is never reached: -.. math:: - - \begin{aligned} - V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B) - \\ - r_A &=& \left(\alpha \sigma_A^6 {\lambda}^p + r^6 \right)^\frac{1}{6} - \\ - r_B &=& \left(\alpha \sigma_B^6 {(1-{\lambda})}^p + r^6 \right)^\frac{1}{6}\end{aligned} +.. math:: \begin{aligned} + V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B) + \\ + r_A &=& \left(\alpha \sigma_A^6 {\lambda}^p + r^6 \right)^\frac{1}{6} + \\ + r_B &=& \left(\alpha \sigma_B^6 {(1-{\lambda})}^p + r^6 \right)^\frac{1}{6}\end{aligned} + :label: eqnfepsoftcore where :math:`V^A` and :math:`V^B` are the normal “hard core” Van der Waals or electrostatic potentials in state A (:math:`{\lambda}=0`) and @@ -258,31 +254,29 @@ the interactions very little for :math:`r > \alpha^{1/6} \sigma` and quickly switch the soft-core interaction to an almost constant value for smaller :math:`r` (:numref:`Fig. %s `). The force is: -.. math:: - - F_{sc}(r) = -\frac{\partial V_{sc}(r)}{\partial r} = - {(1-{\lambda})}F^A(r_A) \left(\frac{r}{r_A}\right)^5 + - {\lambda}F^B(r_B) \left(\frac{r}{r_B}\right)^5 +.. math:: F_{sc}(r) = -\frac{\partial V_{sc}(r)}{\partial r} = + {(1-{\lambda})}F^A(r_A) \left(\frac{r}{r_A}\right)^5 + + {\lambda}F^B(r_B) \left(\frac{r}{r_B}\right)^5 + :label: eqnfepsoftcoreforce where :math:`F^A` and :math:`F^B` are the “hard core” forces. The contribution to the derivative of the free energy is: -.. math:: - - \begin{aligned} - {\frac{\partial V_{sc}(r)}{\partial {\lambda}}} & = & - V^B(r_B) -V^A(r_A) + - {(1-{\lambda})}\frac{\partial V^A(r_A)}{\partial r_A} - \frac{\partial r_A}{\partial {\lambda}} + - {\lambda}\frac{\partial V^B(r_B)}{\partial r_B} - \frac{\partial r_B}{\partial {\lambda}} - \nonumber\\ - &=& - V^B(r_B) -V^A(r_A) + \nonumber \\ - & & - \frac{p \alpha}{6} - \left[ {\lambda}F^B(r_B) r^{-5}_B \sigma_B^6 {(1-{\lambda})}^{p-1} - - {(1-{\lambda})}F^A(r_A) r^{-5}_A \sigma_A^6 {\lambda}^{p-1} \right]\end{aligned} +.. math:: \begin{aligned} + {\frac{\partial V_{sc}(r)}{\partial {\lambda}}} & = & + V^B(r_B) -V^A(r_A) + + {(1-{\lambda})}\frac{\partial V^A(r_A)}{\partial r_A} + \frac{\partial r_A}{\partial {\lambda}} + + {\lambda}\frac{\partial V^B(r_B)}{\partial r_B} + \frac{\partial r_B}{\partial {\lambda}} + \nonumber\\ + &=& + V^B(r_B) -V^A(r_A) + \nonumber \\ + & & + \frac{p \alpha}{6} + \left[ {\lambda}F^B(r_B) r^{-5}_B \sigma_B^6 {(1-{\lambda})}^{p-1} - + {(1-{\lambda})}F^A(r_A) r^{-5}_A \sigma_A^6 {\lambda}^{p-1} \right]\end{aligned} + :label: eqnfepsoftcorederivative The original GROMOS Lennard-Jones soft-core function\ :ref:`100 ` uses :math:`p=2`, but :math:`p=1` gives a smoother @@ -321,14 +315,13 @@ that in most cases gives lower and more even statistical variance than the standard soft-core path described above \ :ref:`101 `, :ref:`102 `. Specifically, we have: -.. math:: - - \begin{aligned} - V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B) - \\ - r_A &=& \left(\alpha \sigma_A^{48} {\lambda}^p + r^{48} \right)^\frac{1}{48} - \\ - r_B &=& \left(\alpha \sigma_B^{48} {(1-{\lambda})}^p + r^{48} \right)^\frac{1}{48}\end{aligned} +.. math:: \begin{aligned} + V_{sc}(r) &=& {(1-{\lambda})}V^A(r_A) + {\lambda}V^B(r_B) + \\ + r_A &=& \left(\alpha \sigma_A^{48} {\lambda}^p + r^{48} \right)^\frac{1}{48} + \\ + r_B &=& \left(\alpha \sigma_B^{48} {(1-{\lambda})}^p + r^{48} \right)^\frac{1}{48}\end{aligned} + :label: eqnnewsoftcore This “1-1-48” path is also implemented in |Gromacs|. Note that for this path the soft core :math:`\alpha` should satisfy diff --git a/docs/reference-manual/functions/interaction-methods.rst b/docs/reference-manual/functions/interaction-methods.rst index 78e7493ffe..45812f98bc 100644 --- a/docs/reference-manual/functions/interaction-methods.rst +++ b/docs/reference-manual/functions/interaction-methods.rst @@ -129,16 +129,16 @@ can be found in ref. \ :ref:`104 `. We can write the potential energy as: .. math:: V = V(\mathbf{r}_s,\mathbf{r}_1,\ldots,\mathbf{r}_n) = V^*(\mathbf{r}_1,\ldots,\mathbf{r}_n) + :label: eqnvsiteepot The force on the particle :math:`i` is then: -.. math:: - - \mathbf{F}_i = -\frac{\partial V^*}{\partial \mathbf{r}_i} - = -\frac{\partial V}{\partial \mathbf{r}_i} - - \frac{\partial V}{\partial \mathbf{r}_s} - \frac{\partial \mathbf{r}_s}{\partial \mathbf{r}_i} - = \mathbf{F}_i^{direct} + \mathbf{F}_i +.. math:: \mathbf{F}_i = -\frac{\partial V^*}{\partial \mathbf{r}_i} + = -\frac{\partial V}{\partial \mathbf{r}_i} - + \frac{\partial V}{\partial \mathbf{r}_s} + \frac{\partial \mathbf{r}_s}{\partial \mathbf{r}_i} + = \mathbf{F}_i^{direct} + \mathbf{F}_i + :label: eqnvsiteforce The first term is the normal force. The second term is the force on particle :math:`i` due to the virtual site, which can be written in @@ -185,10 +185,12 @@ the available virtual site constructions. The conceptually simplest construction types are linear combinations: .. math:: \mathbf{r}_s = \sum_{i=1}^N w_i \, \mathbf{r}_i + :label: eqnvsitelincomb The force is then redistributed using the same weights: .. math:: \mathbf{F}_i = w_i \, \mathbf{F}_{s} + :label: eqnvsitelincombforce The types of virtual sites supported in |Gromacs| are given in the list below. Constructing atoms in virtual sites can be virtual sites @@ -199,6 +201,7 @@ can be constructed from “particles” that are simpler virtual sites. (:numref:`Fig. %s ` 2): .. math:: w_i = 1 - a ~,~~ w_j = a + :label: eqnvsitelin2atom - In this case the virtual site is on the line through atoms :math:`i` and :math:`j`. @@ -207,6 +210,7 @@ can be constructed from “particles” that are simpler virtual sites. (:numref:`Fig. %s ` 3): .. math:: w_i = 1 - a - b ~,~~ w_j = a ~,~~ w_k = b + :label: eqnvsitelin3atom - In this case the virtual site is in the plane of the other three particles. @@ -214,29 +218,27 @@ can be constructed from “particles” that are simpler virtual sites. - In the plane of three atoms, with a fixed distance (:numref:`Fig. %s ` 3fd): - .. math:: - - \mathbf{r}_s ~=~ \mathbf{r}_i + b \frac{ \mathbf{r}_ij + a \mathbf{r}_{jk} } - { | \mathbf{r}_ij + a \mathbf{r}_{jk} | } + .. math:: \mathbf{r}_s ~=~ \mathbf{r}_i + b \frac{ \mathbf{r}_ij + a \mathbf{r}_{jk} } + { | \mathbf{r}_ij + a \mathbf{r}_{jk} | } + :label: eqnvsiteplane3atom - In this case the virtual site is in the plane of the other three particles at a distance of :math:`|b|` from :math:`i`. The force on particles :math:`i`, :math:`j` and :math:`k` due to the force on the virtual site can be computed as: - .. math:: - - \begin{array}{lcr} - \mathbf{F}_i &=& \displaystyle \mathbf{F}_{s} - \gamma ( \mathbf{F}_is - \mathbf{p} ) \\[1ex] - \mathbf{F}_j &=& \displaystyle (1-a)\gamma (\mathbf{F}_{s} - \mathbf{p}) \\[1ex] - \mathbf{F}_k &=& \displaystyle a \gamma (\mathbf{F}_{s} - \mathbf{p}) \\ - \end{array} - ~\mbox{~ where~ }~ - \begin{array}{c} - \displaystyle \gamma = \frac{b}{ | \mathbf{r}_ij + a \mathbf{r}_{jk} | } \\[2ex] - \displaystyle \mathbf{p} = \frac{ \mathbf{r}_{is} \cdot \mathbf{F}_{s} } - { \mathbf{r}_{is} \cdot \mathbf{r}_is } \mathbf{r}_is - \end{array} + .. math:: \begin{array}{lcr} + \mathbf{F}_i &=& \displaystyle \mathbf{F}_{s} - \gamma ( \mathbf{F}_is - \mathbf{p} ) \\[1ex] + \mathbf{F}_j &=& \displaystyle (1-a)\gamma (\mathbf{F}_{s} - \mathbf{p}) \\[1ex] + \mathbf{F}_k &=& \displaystyle a \gamma (\mathbf{F}_{s} - \mathbf{p}) \\ + \end{array} + ~\mbox{~ where~ }~ + \begin{array}{c} + \displaystyle \gamma = \frac{b}{ | \mathbf{r}_ij + a \mathbf{r}_{jk} | } \\[2ex] + \displaystyle \mathbf{p} = \frac{ \mathbf{r}_{is} \cdot \mathbf{F}_{s} } + { \mathbf{r}_{is} \cdot \mathbf{r}_is } \mathbf{r}_is + \end{array} + :label: eqnvsiteplane3atomforce - In the plane of three atoms, with a fixed angle and distance (:numref:`Fig. %s ` 3fad): @@ -262,66 +264,63 @@ can be constructed from “particles” that are simpler virtual sites. :math:`\mathbf{r}_\perp` as defined in :eq:`eqn. %s `): - .. math:: - - \begin{array}{c} - \begin{array}{lclllll} - \mathbf{F}_i &=& \mathbf{F}_{s} &-& - \dfrac{d \cos \theta}{ | \mathbf{r}_ij | } \mathbf{F}_1 &+& - \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \left( - \dfrac{ \mathbf{r}_ij \cdot \mathbf{r}_{jk} } - { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{F}_2 + - \mathbf{F}_3 \right) \\[3ex] - \mathbf{F}_j &=& && - \dfrac{d \cos \theta}{ | \mathbf{r}_ij | } \mathbf{F}_1 &-& - \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \left( - \mathbf{F}_2 + - \dfrac{ \mathbf{r}_ij \cdot \mathbf{r}_{jk} } - { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{F}_2 + - \mathbf{F}_3 \right) \\[3ex] - \mathbf{F}_k &=& && && - \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \mathbf{F}_2 \\[3ex] - \end{array} \\[5ex] - \mbox{where ~} - \mathbf{F}_1 = \mathbf{F}_{s} - - \dfrac{ \mathbf{r}_ij \cdot \mathbf{F}_{s} } - { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{r}_{ij} - \mbox{\,, ~} - \mathbf{F}_2 = \mathbf{F}_1 - - \dfrac{ \mathbf{r}_\perp \cdot \mathbf{F}_{s} } - { \mathbf{r}_\perp \cdot \mathbf{r}_\perp } \mathbf{r}_\perp - \mbox{~and ~} - \mathbf{F}_3 = \dfrac{ \mathbf{r}_ij \cdot \mathbf{F}_{s} } - { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{r}_\perp - \end{array} + .. math:: \begin{array}{c} + \begin{array}{lclllll} + \mathbf{F}_i &=& \mathbf{F}_{s} &-& + \dfrac{d \cos \theta}{ | \mathbf{r}_ij | } \mathbf{F}_1 &+& + \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \left( + \dfrac{ \mathbf{r}_ij \cdot \mathbf{r}_{jk} } + { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{F}_2 + + \mathbf{F}_3 \right) \\[3ex] + \mathbf{F}_j &=& && + \dfrac{d \cos \theta}{ | \mathbf{r}_ij | } \mathbf{F}_1 &-& + \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \left( + \mathbf{F}_2 + + \dfrac{ \mathbf{r}_ij \cdot \mathbf{r}_{jk} } + { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{F}_2 + + \mathbf{F}_3 \right) \\[3ex] + \mathbf{F}_k &=& && && + \dfrac{d \sin \theta}{ | \mathbf{r}_\perp | } \mathbf{F}_2 \\[3ex] + \end{array} \\[5ex] + \mbox{where ~} + \mathbf{F}_1 = \mathbf{F}_{s} - + \dfrac{ \mathbf{r}_ij \cdot \mathbf{F}_{s} } + { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{r}_{ij} + \mbox{\,, ~} + \mathbf{F}_2 = \mathbf{F}_1 - + \dfrac{ \mathbf{r}_\perp \cdot \mathbf{F}_{s} } + { \mathbf{r}_\perp \cdot \mathbf{r}_\perp } \mathbf{r}_\perp + \mbox{~and ~} + \mathbf{F}_3 = \dfrac{ \mathbf{r}_ij \cdot \mathbf{F}_{s} } + { \mathbf{r}_ij \cdot \mathbf{r}_{ij} } \mathbf{r}_\perp + \end{array} + :label: eqnvsite2fadFforce - As a non-linear combination of three atoms, out of plane (:numref:`Fig. %s ` 3out): - .. math:: - - \mathbf{r}_s ~=~ \mathbf{r}_i + a \mathbf{r}_ij + b \mathbf{r}_{ik} + - c (\mathbf{r}_ij \times \mathbf{r}_{ik}) + .. math:: \mathbf{r}_s ~=~ \mathbf{r}_i + a \mathbf{r}_ij + b \mathbf{r}_{ik} + + c (\mathbf{r}_ij \times \mathbf{r}_{ik}) + :label: eqnvsitenonlin3atom - This enables the construction of virtual sites out of the plane of the other atoms. The force on particles :math:`i,j` and :math:`k` due to the force on the virtual site can be computed as: - .. math:: - - \begin{array}{lcl} - \mathbf{F}_j &=& \left[\begin{array}{ccc} - a & -c\,z_{ik} & c\,y_{ik} \\[0.5ex] - c\,z_{ik} & a & -c\,x_{ik} \\[0.5ex] - -c\,y_{ik} & c\,x_{ik} & a - \end{array}\right]\mathbf{F}_{s} \\ - \mathbf{F}_k &=& \left[\begin{array}{ccc} - b & c\,z_{ij} & -c\,y_{ij} \\[0.5ex] - -c\,z_{ij} & b & c\,x_{ij} \\[0.5ex] - c\,y_{ij} & -c\,x_{ij} & b - \end{array}\right]\mathbf{F}_{s} \\ - \mathbf{F}_i &=& \mathbf{F}_{s} - \mathbf{F}_j - \mathbf{F}_k - \end{array} + .. math:: \begin{array}{lcl} + \mathbf{F}_j &=& \left[\begin{array}{ccc} + a & -c\,z_{ik} & c\,y_{ik} \\[0.5ex] + c\,z_{ik} & a & -c\,x_{ik} \\[0.5ex] + -c\,y_{ik} & c\,x_{ik} & a + \end{array}\right]\mathbf{F}_{s} \\ + \mathbf{F}_k &=& \left[\begin{array}{ccc} + b & c\,z_{ij} & -c\,y_{ij} \\[0.5ex] + -c\,z_{ij} & b & c\,x_{ij} \\[0.5ex] + c\,y_{ij} & -c\,x_{ij} & b + \end{array}\right]\mathbf{F}_{s} \\ + \mathbf{F}_i &=& \mathbf{F}_{s} - \mathbf{F}_j - \mathbf{F}_k + \end{array} + :label: eqnvsitenonlin3atomforce - From four atoms, with a fixed distance, see separate :numref:`Fig. %s `. This construction is a bit complex, @@ -367,6 +366,7 @@ can be constructed from “particles” that are simpler virtual sites. weights :math:`a_i`. The weight for atom :math:`i` is: .. math:: w_i = a_i \left(\sum_{j=1}^N a_j \right)^{-1} + :label: eqnvsiterelweight - There are three options for setting the weights: diff --git a/docs/reference-manual/functions/long-range-electrostatics.rst b/docs/reference-manual/functions/long-range-electrostatics.rst index 7c8733f6d4..3b24f2df72 100644 --- a/docs/reference-manual/functions/long-range-electrostatics.rst +++ b/docs/reference-manual/functions/long-range-electrostatics.rst @@ -25,18 +25,17 @@ interactions of the periodic images in crystals \ :ref:`105 `. The is to convert the single slowly-converging sum :eq:`eqn. %s ` into two quickly-converging terms and a constant term: -.. math:: - - \begin{aligned} - V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex] - V_{\mathrm{dir}} &=& \frac{f}{2} \sum_{i,j}^{N} - \sum_{n_x}\sum_{n_y} - \sum_{n_{z}*} q_i q_j \frac{\mbox{erfc}(\beta {r}_{ij,{\bf n}} )}{{r}_{ij,{\bf n}}} \\[0.5ex] - V_{\mathrm{rec}} &=& \frac{f}{2 \pi V} \sum_{i,j}^{N} q_i q_j - \sum_{m_x}\sum_{m_y} - \sum_{m_{z}*} \frac{\exp{\left( -(\pi {\bf m}/\beta)^2 + 2 \pi i - {\bf m} \cdot ({\bf r}_i - {\bf r}_j)\right)}}{{\bf m}^2} \\[0.5ex] - V_{0} &=& -\frac{f \beta}{\sqrt{\pi}}\sum_{i}^{N} q_i^2,\end{aligned} +.. math:: \begin{aligned} + V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex] + V_{\mathrm{dir}} &=& \frac{f}{2} \sum_{i,j}^{N} + \sum_{n_x}\sum_{n_y} + \sum_{n_{z}*} q_i q_j \frac{\mbox{erfc}(\beta {r}_{ij,{\bf n}} )}{{r}_{ij,{\bf n}}} \\[0.5ex] + V_{\mathrm{rec}} &=& \frac{f}{2 \pi V} \sum_{i,j}^{N} q_i q_j + \sum_{m_x}\sum_{m_y} + \sum_{m_{z}*} \frac{\exp{\left( -(\pi {\bf m}/\beta)^2 + 2 \pi i + {\bf m} \cdot ({\bf r}_i - {\bf r}_j)\right)}}{{\bf m}^2} \\[0.5ex] + V_{0} &=& -\frac{f \beta}{\sqrt{\pi}}\sum_{i}^{N} q_i^2,\end{aligned} + :label: eqntotalcoloumbseparate where :math:`\beta` is a parameter that determines the relative weight of the direct and reciprocal sums and :math:`{\bf m}=(m_x,m_y,m_z)`. In diff --git a/docs/reference-manual/functions/long-range-vdw.rst b/docs/reference-manual/functions/long-range-vdw.rst index d46f3315cb..c0f462ec92 100644 --- a/docs/reference-manual/functions/long-range-vdw.rst +++ b/docs/reference-manual/functions/long-range-vdw.rst @@ -31,10 +31,12 @@ the cut-off distance :math:`r_c`. The dispersion energy between two particles is written as: .. math:: V({r_{ij}}) ~=~- C_6\,{r_{ij}}^{-6} + :label: eqnlrljEdisp and the corresponding force is: .. math:: \mathbf{F}_ij ~=~- 6\,C_6\,r_{ij}^{-8}\mathbf{r}_ij + :label: eqnlrljFdisp In a periodic system it is not easy to calculate the full potentials, so usually a cut-off is applied, which can be abrupt or smooth. We will @@ -54,28 +56,25 @@ and is 0 beyond the cut-off distance :math:`r_c`. We can integrate :math:`r_1` is equal to the global density and the radial distribution function :math:`g(r)` is 1 beyond :math:`r_1`: -.. math:: - - \begin{aligned} - \nonumber - V_{lr} &=& {\frac{1}{2}}N \left( - \rho\int_0^{r_1} 4\pi r^2 g(r) \, C_6 \,S\,{{{\rm d}r}} - + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {{{\rm d}r}} - + \rho\int_{r_c}^{\infty} 4\pi r^2 V(r) \, {{{\rm d}r}} - \right) \\ - & = & {\frac{1}{2}}N \left(\left(\frac{4}{3}\pi \rho r_1^{3} - 1\right) C_6 \,S - + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {{{\rm d}r}} - -\frac{4}{3} \pi N \rho\, C_6\,r_c^{-3} - \right)\end{aligned} +.. math:: \begin{aligned} + V_{lr} &=& {\frac{1}{2}}N \left( + \rho\int_0^{r_1} 4\pi r^2 g(r) \, C_6 \,S\,{{{\rm d}r}} + + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {{{\rm d}r}} + + \rho\int_{r_c}^{\infty} 4\pi r^2 V(r) \, {{{\rm d}r}} + \right) \\ + & = & {\frac{1}{2}}N \left(\left(\frac{4}{3}\pi \rho r_1^{3} - 1\right) C_6 \,S + + \rho\int_{r_1}^{r_c} 4\pi r^2 \left( V(r) -V_c(r) \right) {{{\rm d}r}} + -\frac{4}{3} \pi N \rho\, C_6\,r_c^{-3} + \right)\end{aligned} + :label: eqnlrljshift where the term :math:`-1` corrects for the self-interaction. For a plain cut-off we only need to assume that :math:`g(r)` is 1 beyond :math:`r_c` and the correction reduces to \ :ref:`108 `: -.. math:: - - \begin{aligned} - V_{lr} & = & -\frac{2}{3} \pi N \rho\, C_6\,r_c^{-3}\end{aligned} +.. math:: \begin{aligned} + V_{lr} & = & -\frac{2}{3} \pi N \rho\, C_6\,r_c^{-3}\end{aligned} + :label: eqnlrljcorrreduced If we consider, for example, a box of pure water, simulated with a cut-off of 0.9 nm and a density of 1 g cm\ :math:`^{-3}` this correction @@ -101,30 +100,33 @@ The scalar virial of the system due to the dispersion interaction between two particles :math:`i` and :math:`j` is given by: .. math:: \Xi~=~-{\frac{1}{2}} \mathbf{r}_ij \cdot \mathbf{F}_ij ~=~ 3\,C_6\,r_{ij}^{-6} + :label: eqnlrljdispvirial The pressure is given by: .. math:: P~=~\frac{2}{3\,V}\left(E_{kin} - \Xi\right) + :label: eqnlrljpressure The long-range correction to the virial is given by: .. math:: \Xi_{lr} ~=~ {\frac{1}{2}}N \rho \int_0^{\infty} 4\pi r^2 g(r) (\Xi -\Xi_c) \,{{\rm d}r} + :label: eqnlrljcorrvirial We can again integrate the long-range contribution to the virial assuming :math:`g(r)` is 1 beyond :math:`r_1`: -.. math:: - - \begin{aligned} - \Xi_{lr}&=& {\frac{1}{2}}N \rho \left( - \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \,{{\rm d}r}+ \int_{r_c}^{\infty} 4 \pi r^2 3\,C_6\,{r_{ij}}^{-6}\, {{\rm d}r}\right) \nonumber\\ - &=& {\frac{1}{2}}N \rho \left( - \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \, {{\rm d}r}+ 4 \pi C_6 \, r_c^{-3} \right)\end{aligned} +.. math:: \begin{aligned} + \Xi_{lr}&=& {\frac{1}{2}}N \rho \left( + \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \,{{\rm d}r}+ \int_{r_c}^{\infty} 4 \pi r^2 3\,C_6\,{r_{ij}}^{-6}\, {{\rm d}r}\right) \nonumber\\ + &=& {\frac{1}{2}}N \rho \left( + \int_{r_1}^{r_c} 4 \pi r^2 (\Xi -\Xi_c) \, {{\rm d}r}+ 4 \pi C_6 \, r_c^{-3} \right)\end{aligned} + :label: eqnlrljvirialcontrib For a plain cut-off the correction to the pressure is \ :ref:`108 `: .. math:: P_{lr}~=~-\frac{4}{3} \pi C_6\, \rho^2 r_c^{-3} + :label: eqnlrljpressurecorr Using the same example of a water box, the correction to the virial is 0.75 kJ mol\ :math:`^{-1}` per molecule, the corresponding correction to @@ -155,11 +157,11 @@ this case the modified Ewald equations become \end{aligned} :label: eqnljpmerealspace -.. math:: - \begin{aligned} - V_{\mathrm{rec}} &=& \frac{{\pi}^{\frac{3}{2}} \beta^{3}}{2V} \sum_{m_x}\sum_{m_y}\sum_{m_{z}*} - f(\pi |{\mathbf m}|/\beta) \times \sum_{i,j}^{N} C^{ij}_6 {\mathrm{exp}}\left[-2\pi i {\bf m}\cdot({\bf r_i}-{\bf r_j})\right] \\[0.5ex] - V_{0} &=& -\frac{\beta^{6}}{12}\sum_{i}^{N} C^{ii}_6\end{aligned} +.. math:: \begin{aligned} + V_{\mathrm{rec}} &=& \frac{{\pi}^{\frac{3}{2}} \beta^{3}}{2V} \sum_{m_x}\sum_{m_y}\sum_{m_{z}*} + f(\pi | {\mathbf m} | /\beta) \times \sum_{i,j}^{N} C^{ij}_6 {\mathrm{exp}}\left[-2\pi i {\bf m}\cdot({\bf r_i}-{\bf r_j})\right] \\[0.5ex] + V_{0} &=& -\frac{\beta^{6}}{12}\sum_{i}^{N} C^{ii}_6\end{aligned} + :label: eqnljpmerealspace2 where :math:`{\bf m}=(m_x,m_y,m_z)`, :math:`\beta` is the parameter determining the weight between direct and reciprocal space, and @@ -171,23 +173,24 @@ particles. Following the derivation by Essmann \ :ref:`15 `, the functions :math:`f` and :math:`g` introduced above are defined as -.. math:: - - \begin{aligned} - f(x)&=&1/3\left[(1-2x^2){\mathrm{exp}}(-x^2) + 2{x^3}\sqrt{\pi}\,{\mathrm{erfc}}(x) \right] \\ - g(x)&=&{\mathrm{exp}}(-x^2)(1+x^2+\frac{x^4}{2}).\end{aligned} +.. math:: \begin{aligned} + f(x)&=&1/3\left[(1-2x^2){\mathrm{exp}}(-x^2) + 2{x^3}\sqrt{\pi}\,{\mathrm{erfc}}(x) \right] \\ + g(x)&=&{\mathrm{exp}}(-x^2)(1+x^2+\frac{x^4}{2}).\end{aligned} + :label: eqnljpmerealdistance The above methodology works fine as long as the dispersion parameters can be combined geometrically (:eq:`eqn. %s `) in the same way as the charges for electrostatics .. math:: C^{ij}_{6,\mathrm{geom}} = \left(C^{ii}_6 \, C^{jj}_6\right)^{1/2} + :label: eqnljpmegeom For Lorentz-Berthelot combination rules (:eq:`eqn. %s `), the reciprocal part of this sum has to be calculated seven times due to the splitting of the dispersion parameter according to .. math:: C^{ij}_{6,\mathrm{L-B}} = (\sigma_i+\sigma_j)^6=\sum_{n=0}^{6} P_{n}\sigma_{i}^{n}\sigma_{j}^{(6-n)}, + :label: eqnljpmelorenztberthelot for :math:`P_{n}` the Pascal triangle coefficients. This introduces a non-negligible cost to the reciprocal part, requiring seven separate @@ -197,12 +200,11 @@ geometrical combination rules in order to calculate an approximate interaction parameter for the reciprocal part of the potential, yielding a total interaction of -.. math:: - - \begin{aligned} - V(rr_c) & = & \underbrace{C^\mathrm{recip}_{6,\mathrm{geom}} [1 - g(\beta r)] r^{-6}}_{\mathrm{Reciprocal \ space}}.\end{aligned} +.. math:: \begin{aligned} + V(rr_c) & = & \underbrace{C^\mathrm{recip}_{6,\mathrm{geom}} [1 - g(\beta r)] r^{-6}}_{\mathrm{Reciprocal \ space}}.\end{aligned} + :label: eqnpmearith This will preserve a well-defined Hamiltonian and significantly increase the performance of the simulations. The approximation does @@ -231,10 +233,9 @@ interaction is given by \end{aligned} :label: eqnljpmecorr2 -.. math:: - - \begin{aligned} - V(r>r_c) &=& C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}.\end{aligned} +.. math:: \begin{aligned} + V(r>r_c) &=& C^\mathrm{recip}_6 [1 - g(\beta r)] r^{-6}.\end{aligned} + :label: eqnljpmecorr3 For the case when :math:`C^{\mathrm{dir}}_6 \neq C^\mathrm{recip}_6` this will retain an unmodified LJ force up to the cut-off, and the error @@ -244,6 +245,7 @@ reciprocal space. When using a VdW interaction modifier of potential-shift, the constant .. math:: \left(-C^{\mathrm{dir}}_6 + C^\mathrm{recip}_6 [1 - g(\beta r_c)]\right) r_c^{-6} + :label: eqnljpmeconstant is added to :eq:`eqn. %s ` in order to ensure that the potential is continuous at the cutoff. Note that, in the same way as diff --git a/docs/reference-manual/functions/nonbonded-interactions.rst b/docs/reference-manual/functions/nonbonded-interactions.rst index 914e55d6d7..b0a891ec3b 100644 --- a/docs/reference-manual/functions/nonbonded-interactions.rst +++ b/docs/reference-manual/functions/nonbonded-interactions.rst @@ -4,8 +4,10 @@ Non-bonded interactions Non-bonded interactions in |Gromacs| are pair-additive: .. math:: V(\mathbf{r}_1,\ldots \mathbf{r}_N) = \sum_{i` The parameters :math:`C^{(12)}_{ij}` and :math:`C^{(6)}_{ij}` depend on pairs of *atom types*; consequently they @@ -48,6 +49,7 @@ The force derived from this potential is: .. math:: \mathbf{F}_i(\mathbf{r}_ij) = \left( 12~\frac{C_{ij}^{(12)}}{{r_{ij}}^{13}} - 6~\frac{C_{ij}^{(6)}}{{r_{ij}}^7} \right) {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} + :label: eqnljforce The LJ potential may also be written in the following form: @@ -82,6 +84,7 @@ finally an geometric average for both parameters can be used (type 3): \sigma_{ij} &=& \left({\sigma_{ii} \, \sigma_{jj}}\right)^{1/2} \\ \epsilon_{ij} &=& \left({\epsilon_{ii} \, \epsilon_{jj}}\right)^{1/2} \end{array} + :label: eqnnbgeometricaverage This last rule is used by the OPLS force field. @@ -92,10 +95,9 @@ The Buckingham potential has a more flexible and realistic repulsion term than the Lennard-Jones interaction, but is also more expensive to compute. The potential form is: -.. math:: - - V_{bh}({r_{ij}}) = A_{ij} \exp(-B_{ij} {r_{ij}}) - - \frac{C_{ij}}{{r_{ij}}^6} +.. math:: V_{bh}({r_{ij}}) = A_{ij} \exp(-B_{ij} {r_{ij}}) - + \frac{C_{ij}}{{r_{ij}}^6} + :label: eqnnbbuckingham .. _fig-bham: @@ -106,10 +108,9 @@ compute. The potential form is: See also :numref:`Fig. %s `. The force derived from this is: -.. math:: - - \mathbf{F}_i({r_{ij}}) = \left[ A_{ij}B_{ij}\exp(-B_{ij} {r_{ij}}) - - 6\frac{C_{ij}}{{r_{ij}}^7} \right] {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} +.. math:: \mathbf{F}_i({r_{ij}}) = \left[ A_{ij}B_{ij}\exp(-B_{ij} {r_{ij}}) - + 6\frac{C_{ij}}{{r_{ij}}^7} \right] {\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} + :label: eqnnbbuckinghamforce .. _coul: @@ -138,6 +139,7 @@ See also :numref:`Fig. %s `, where The force derived from this potential is: .. math:: \mathbf{F}_i(\mathbf{r}_ij) = f \frac{q_i q_j}{{\varepsilon_r}{r_{ij}}^2}{\frac{{\mathbf{r}_{ij}}}{{r_{ij}}}} + :label: eqnfcoul A plain Coulomb interaction should only be used without cut-off or when all pairs fall within the cut-off, since there is an abrupt, large @@ -174,6 +176,7 @@ to neutralization with a homogeneous background charge. We can rewrite :eq:`eqn. %s ` for simplicity as .. math:: V_{crf} ~=~ f \frac{q_i q_j}{{\varepsilon_r}}\left[\frac{1}{{r_{ij}}} + k_{rf}~ {r_{ij}}^2 -c_{rf}\right] + :label: eqnvcrfrewrite with @@ -257,84 +260,87 @@ van der Waals force acting on particle :math:`i` by particle :math:`j` as: .. math:: \mathbf{F}_i = c \, F(r_{ij}) \frac{\mathbf{r}_ij}{r_{ij}} + :label: eqnswitch For pure Coulomb or Lennard-Jones interactions :math:`F(r) = F_\alpha(r) = \alpha \, r^{-(\alpha+1)}`. The switched force :math:`F_s(r)` can generally be written as: -.. math:: - - \begin{array}{rcl} - F_s(r)~=&~F_\alpha(r) & r < r_1 \\ - F_s(r)~=&~F_\alpha(r)+S(r) & r_1 \le r < r_c \\ - F_s(r)~=&~0 & r_c \le r - \end{array} +.. math:: \begin{array}{rcl} + F_s(r)~=&~F_\alpha(r) & r < r_1 \\ + F_s(r)~=&~F_\alpha(r)+S(r) & r_1 \le r < r_c \\ + F_s(r)~=&~0 & r_c \le r + \end{array} + :label: eqnswitchforce When :math:`r_1=0` this is a traditional shift function, otherwise it acts as a switch function. The corresponding shifted potential function then reads: .. math:: V_s(r) = \int^{\infty}_r~F_s(x)\, dx + :label: eqnswitchpotential The |Gromacs| **force switch** function :math:`S_F(r)` should be smooth at the boundaries, therefore the following boundary conditions are imposed on the switch function: -.. math:: - - \begin{array}{rcl} - S_F(r_1) &=&0 \\ - S_F'(r_1) &=&0 \\ - S_F(r_c) &=&-F_\alpha(r_c) \\ - S_F'(r_c) &=&-F_\alpha'(r_c) - \end{array} +.. math:: \begin{array}{rcl} + S_F(r_1) &=&0 \\ + S_F'(r_1) &=&0 \\ + S_F(r_c) &=&-F_\alpha(r_c) \\ + S_F'(r_c) &=&-F_\alpha'(r_c) + \end{array} + :label: eqnswitchforcefunction A 3\ :math:`^{rd}` degree polynomial of the form .. math:: S_F(r) = A(r-r_1)^2 + B(r-r_1)^3 + :label: eqnswitchforcepoly fulfills these requirements. The constants A and B are given by the boundary condition at :math:`r_c`: -.. math:: - - \begin{array}{rcl} - A &~=~& -\alpha \, \displaystyle - \frac{(\alpha+4)r_c~-~(\alpha+1)r_1} {r_c^{\alpha+2}~(r_c-r_1)^2} \\ - B &~=~& \alpha \, \displaystyle - \frac{(\alpha+3)r_c~-~(\alpha+1)r_1}{r_c^{\alpha+2}~(r_c-r_1)^3} - \end{array} +.. math:: \begin{array}{rcl} + A &~=~& -\alpha \, \displaystyle + \frac{(\alpha+4)r_c~-~(\alpha+1)r_1} {r_c^{\alpha+2}~(r_c-r_1)^2} \\ + B &~=~& \alpha \, \displaystyle + \frac{(\alpha+3)r_c~-~(\alpha+1)r_1}{r_c^{\alpha+2}~(r_c-r_1)^3} + \end{array} + :label: eqnforceswitchboundary Thus the total force function is: .. math:: F_s(r) = \frac{\alpha}{r^{\alpha+1}} + A(r-r_1)^2 + B(r-r_1)^3 + :label: eqnswitchfinalforce and the potential function reads: .. math:: V_s(r) = \frac{1}{r^\alpha} - \frac{A}{3} (r-r_1)^3 - \frac{B}{4} (r-r_1)^4 - C + :label: eqnswitchfinalpotential where .. math:: C = \frac{1}{r_c^\alpha} - \frac{A}{3} (r_c-r_1)^3 - \frac{B}{4} (r_c-r_1)^4 + :label: eqnswitchpotentialexp The |Gromacs| **potential-switch** function :math:`S_V(r)` scales the potential between :math:`r_1` and :math:`r_c`, and has similar boundary conditions, intended to produce smoothly-varying potential and forces: -.. math:: - - \begin{array}{rcl} - S_V(r_1) &=&1 \\ - S_V'(r_1) &=&0 \\ - S_V''(r_1) &=&0 \\ - S_V(r_c) &=&0 \\ - S_V'(r_c) &=&0 \\ - S_V''(r_c) &=&0 - \end{array} +.. math:: \begin{array}{rcl} + S_V(r_1) &=&1 \\ + S_V'(r_1) &=&0 \\ + S_V''(r_1) &=&0 \\ + S_V(r_c) &=&0 \\ + S_V'(r_c) &=&0 \\ + S_V''(r_c) &=&0 + \end{array} + :label: eqnpotentialswitch The fifth-degree polynomial that has these properties is .. math:: S_V(r; r_1, r_c) = \frac{1 - 10(r-r_1)^3(r_c-r_1)^2 + 15(r-r_1)^4(r_c-r_1) - 6(r-r_1)}{(r_c-r_1)^5} + :label: eqn5polynomal This implementation is found in several other simulation packages,\ :ref:`73 `\ :ref:`75 ` but @@ -354,6 +360,7 @@ cut-off, instead of the force. In this case the short range potential is given by: .. math:: V(r) = f \frac{\mbox{erfc}(\beta r_{ij})}{r_{ij}} q_i q_j, + :label: eqnewaldsrmod where :math:`\beta` is a parameter that determines the relative weight between the direct space sum and the reciprocal space sum and diff --git a/docs/reference-manual/functions/polarization.rst b/docs/reference-manual/functions/polarization.rst index f6cc83eea4..c332a3df56 100644 --- a/docs/reference-manual/functions/polarization.rst +++ b/docs/reference-manual/functions/polarization.rst @@ -25,6 +25,7 @@ in this case the polarizability volume is 0.001 nm\ :math:`^3` (or 1 is used \ :ref:`45 `: .. math:: k_{cs} ~=~ \frac{q_s^2}{\alpha} + :label: eqnsimplepol where :math:`q_s` is the charge on the shell particle. @@ -36,11 +37,10 @@ McKerell \ :ref:`93 ` it was found that some particles can overpolarize and this was fixed by introducing a higher order term in the polarization energy: -.. math:: - - \begin{aligned} - V_{pol} ~=& \frac{k_{cs}}{2} r_{cs}^2 & r_{cs} \le \delta \\ - =& \frac{k_{cs}}{2} r_{cs}^2 + k_{hyp} (r_{cs}-\delta)^4 & r_{cs} > \delta\end{aligned} +.. math:: \begin{aligned} + V_{pol} ~=& \frac{k_{cs}}{2} r_{cs}^2 & r_{cs} \le \delta \\ + =& \frac{k_{cs}}{2} r_{cs}^2 + k_{hyp} (r_{cs}-\delta)^4 & r_{cs} > \delta\end{aligned} + :label: eqnanharmpol where :math:`\delta` is a user-defined constant that is set to 0.02 nm for anions in the Drude force field \ :ref:`94 `. Since this @@ -75,11 +75,13 @@ would be too strong. The potential between two shell particles :math:`i` and :math:`j` is: .. math:: V_{thole} ~=~ \frac{q_i q_j}{r_{ij}}\left[1-\left(1+\frac{{\bar{r}_{ij}}}{2}\right){\rm exp}^{-{\bar{r}_{ij}}}\right] + :label: eqntholepol -**Note** that there is a sign error in Equation 1 of Noskov *et -al.* :ref:`98 `: +**Note** that there is a sign error in Equation 1 of Noskov +*et al.*  :ref:`98 `: .. math:: {\bar{r}_{ij}}~=~ a\frac{r_{ij}}{(\alpha_i \alpha_j)^{1/6}} + :label: eqntholsignerror where :math:`a` is a magic (dimensionless) constant, usually chosen to be 2.6 \ :ref:`98 `; :math:`\alpha_i` and diff --git a/docs/reference-manual/functions/restraints.rst b/docs/reference-manual/functions/restraints.rst index a533e79a51..07df0ca993 100644 --- a/docs/reference-manual/functions/restraints.rst +++ b/docs/reference-manual/functions/restraints.rst @@ -31,6 +31,7 @@ implemented in |Gromacs|. The following form is used: .. math:: V_{pr}(\mathbf{r}_i) = {\frac{1}{2}}k_{pr}|\mathbf{r}_i-\mathbf{R}_i|^2 + :label: eqnposrestform The potential is plotted in :numref:`Fig. %s `. @@ -44,16 +45,16 @@ The potential is plotted in :numref:`Fig. %s `. The potential form can be rewritten without loss of generality as: .. math:: V_{pr}(\mathbf{r}_i) = {\frac{1}{2}} \left[ k_{pr}^x (x_i-X_i)^2 ~{\hat{\bf x}} + k_{pr}^y (y_i-Y_i)^2 ~{\hat{\bf y}} + k_{pr}^z (z_i-Z_i)^2 ~{\hat{\bf z}}\right] + :label: eqnposrestgeneral Now the forces are: -.. math:: - - \begin{array}{rcl} - F_i^x &=& -k_{pr}^x~(x_i - X_i) \\ - F_i^y &=& -k_{pr}^y~(y_i - Y_i) \\ - F_i^z &=& -k_{pr}^z~(z_i - Z_i) - \end{array} +.. math:: \begin{array}{rcl} + F_i^x &=& -k_{pr}^x~(x_i - X_i) \\ + F_i^y &=& -k_{pr}^y~(y_i - Y_i) \\ + F_i^z &=& -k_{pr}^z~(z_i - Z_i) + \end{array} + :label: eqnposrestforce Using three different force constants the position restraints can be turned on or off in each spatial dimension; this means that atoms can be @@ -74,6 +75,7 @@ position :math:`\mathbf{R}_i`). The following general potential is used (:numref:`Figure %s ` A): .. math:: V_\mathrm{fb}(\mathbf{r}_i) = \frac{1}{2}k_\mathrm{fb} [d_g(\mathbf{r}_i;\mathbf{R}_i) - r_\mathrm{fb}]^2\,H[d_g(\mathbf{r}_i;\mathbf{R}_i) - r_\mathrm{fb}], + :label: eqnflatbottomposrest where :math:`\mathbf{R}_i` is the reference position, :math:`r_\mathrm{fb}` is the distance from the center with a flat @@ -99,6 +101,7 @@ flat-bottomed potential. the center of the sphere. The following distance calculation is used: .. math:: d_g(\mathbf{r}_i;\mathbf{R}_i) = | \mathbf{r}_i-\mathbf{R}_i | + :label: eqnfbsphereposrest | **Cylinder** (:math:`g=6,7,8`): The particle is kept in a cylinder of given radius parallel to the :math:`x` (:math:`g=6`), :math:`y` @@ -110,17 +113,17 @@ flat-bottomed potential. zero. For a cylinder aligned along the :math:`z`-axis: .. math:: d_g(\mathbf{r}_i;\mathbf{R}_i) = \sqrt{ (x_i-X_i)^2 + (y_i - Y_i)^2 } + :label: eqnfbcylinderposrest | **Layer** (:math:`g=3,4,5`): The particle is kept in a layer defined by the thickness and the normal of the layer. The layer normal can be parallel to the :math:`x`, :math:`y`, or :math:`z`-axis. The force acts parallel to the layer normal. - .. math:: - - d_g(\mathbf{r}_i;\mathbf{R}_i) = |x_i-X_i|, \;\;\;\mbox{or}\;\;\; - d_g(\mathbf{r}_i;\mathbf{R}_i) = |y_i-Y_i|, \;\;\;\mbox{or}\;\;\; - d_g(\mathbf{r}_i;\mathbf{R}_i) = |z_i-Z_i|. + .. math:: d_g(\mathbf{r}_i;\mathbf{R}_i) = |x_i-X_i|, \;\;\;\mbox{or}\;\;\; + d_g(\mathbf{r}_i;\mathbf{R}_i) = |y_i-Y_i|, \;\;\;\mbox{or}\;\;\; + d_g(\mathbf{r}_i;\mathbf{R}_i) = |z_i-Z_i|. + :label: eqnfblayerposrest It is possible to apply multiple independent flat-bottomed position restraints of different geometry on one particle. For example, applying @@ -136,11 +139,10 @@ particle *outside* of the volume defined by negative :math:`r_\mathrm{fb}` in the topology. The following potential is used (:numref:`Figure %s ` B): -.. math:: - - V_\mathrm{fb}^{\mathrm{inv}}(\mathbf{r}_i) = \frac{1}{2}k_\mathrm{fb} - [d_g(\mathbf{r}_i;\mathbf{R}_i) - | r_\mathrm{fb} | ]^2\, - H[ -(d_g(\mathbf{r}_i;\mathbf{R}_i) - | r_\mathrm{fb} | )]. +.. math:: V_\mathrm{fb}^{\mathrm{inv}}(\mathbf{r}_i) = \frac{1}{2}k_\mathrm{fb} + [d_g(\mathbf{r}_i;\mathbf{R}_i) - | r_\mathrm{fb} | ]^2\, + H[ -(d_g(\mathbf{r}_i;\mathbf{R}_i) - | r_\mathrm{fb} | )]. + :label: eqninvertrest Angle restraints ~~~~~~~~~~~~~~~~ @@ -149,24 +151,22 @@ These are used to restrain the angle between two pairs of particles or between one pair of particles and the :math:`z`-axis. The functional form is similar to that of a proper dihedral. For two pairs of atoms: -.. math:: - - V_{ar}(\mathbf{r}_i,\mathbf{r}_j,\mathbf{r}_k,\mathbf{r}_l) - = k_{ar}(1 - \cos(n (\theta - \theta_0)) - ) - ,~~~~\mbox{where}~~ - \theta = \arccos\left(\frac{\mathbf{r}_j -\mathbf{r}_i}{\|\mathbf{r}_j -\mathbf{r}_i\|} - \cdot \frac{\mathbf{r}_l -\mathbf{r}_k}{\|\mathbf{r}_l -\mathbf{r}_k\|} \right) +.. math:: V_{ar}(\mathbf{r}_i,\mathbf{r}_j,\mathbf{r}_k,\mathbf{r}_l) + = k_{ar}(1 - \cos(n (\theta - \theta_0)) + ) + ,~~~~\mbox{where}~~ + \theta = \arccos\left(\frac{\mathbf{r}_j -\mathbf{r}_i}{\|\mathbf{r}_j -\mathbf{r}_i\|} + \cdot \frac{\mathbf{r}_l -\mathbf{r}_k}{\|\mathbf{r}_l -\mathbf{r}_k\|} \right) + :label: eqnanglerest For one pair of atoms and the :math:`z`-axis: -.. math:: - - V_{ar}(\mathbf{r}_i,\mathbf{r}_j) = k_{ar}(1 - \cos(n (\theta - \theta_0)) - ) - ,~~~~\mbox{where}~~ - \theta = \arccos\left(\frac{\mathbf{r}_j -\mathbf{r}_i}{\|\mathbf{r}_j -\mathbf{r}_i\|} - \cdot \left( \begin{array}{c} 0 \\ 0 \\ 1 \\ \end{array} \right) \right) +.. math:: V_{ar}(\mathbf{r}_i,\mathbf{r}_j) = k_{ar}(1 - \cos(n (\theta - \theta_0)) + ) + ,~~~~\mbox{where}~~ + \theta = \arccos\left(\frac{\mathbf{r}_j -\mathbf{r}_i}{\|\mathbf{r}_j -\mathbf{r}_i\|} + \cdot \left( \begin{array}{c} 0 \\ 0 \\ 1 \\ \end{array} \right) \right) + :label: eqnanglerestzaxis A multiplicity (:math:`n`) of 2 is useful when you do not want to distinguish between parallel and anti-parallel vectors. The equilibrium @@ -248,18 +248,17 @@ beyond the largest bound (see :numref:`Fig. %s `). The forces are -.. math:: - - \mathbf{F}_i~=~ \left\{ - \begin{array}{lcllllll} - -k_{dr}(r_{ij}-r_0)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& & & r_{ij} & < & r_0 \\[1.5ex] - 0 &\mbox{for}& r_0 & \le & r_{ij} & < & r_1 \\[1.5ex] - -k_{dr}(r_{ij}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& r_1 & \le & r_{ij} & < & r_2 \\[1.5ex] - -k_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& r_2 & \le & r_{ij} & & - \end{array} \right. +.. math:: \mathbf{F}_i~=~ \left\{ + \begin{array}{lcllllll} + -k_{dr}(r_{ij}-r_0)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& & & r_{ij} & < & r_0 \\[1.5ex] + 0 &\mbox{for}& r_0 & \le & r_{ij} & < & r_1 \\[1.5ex] + -k_{dr}(r_{ij}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& r_1 & \le & r_{ij} & < & r_2 \\[1.5ex] + -k_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& r_2 & \le & r_{ij} & & + \end{array} \right. + :label: eqndisreforce For restraints not derived from NMR data, this functionality will usually suffice and a section of ``[ bonds ]`` type 10 can be used to apply individual @@ -276,18 +275,17 @@ reduce the fluctuations in a molecule significantly. This problem can be overcome by restraining to a *time averaged* distance \ :ref:`91 `. The forces with time averaging are: -.. math:: - - \mathbf{F}_i~=~ \left\{ - \begin{array}{lcllllll} - -k^a_{dr}(\bar{r}_{ij}-r_0)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& & & \bar{r}_{ij} & < & r_0 \\[1.5ex] - 0 &\mbox{for}& r_0 & \le & \bar{r}_{ij} & < & r_1 \\[1.5ex] - -k^a_{dr}(\bar{r}_{ij}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& r_1 & \le & \bar{r}_{ij} & < & r_2 \\[1.5ex] - -k^a_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} - &\mbox{for}& r_2 & \le & \bar{r}_{ij} & & - \end{array} \right. +.. math:: \mathbf{F}_i~=~ \left\{ + \begin{array}{lcllllll} + -k^a_{dr}(\bar{r}_{ij}-r_0)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& & & \bar{r}_{ij} & < & r_0 \\[1.5ex] + 0 &\mbox{for}& r_0 & \le & \bar{r}_{ij} & < & r_1 \\[1.5ex] + -k^a_{dr}(\bar{r}_{ij}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& r_1 & \le & \bar{r}_{ij} & < & r_2 \\[1.5ex] + -k^a_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} + &\mbox{for}& r_2 & \le & \bar{r}_{ij} & & + \end{array} \right. + :label: eqntimeaveragerest where :math:`\bar{r}_{ij}` is given by an exponential running average with decay time :math:`\tau`: @@ -299,6 +297,7 @@ The force constant :math:`k^a_{dr}` is switched on slowly to compensate for the lack of history at the beginning of the simulation: .. math:: k^a_{dr} = k_{dr} \left(1-\exp\left(-\frac{t}{\tau}\right)\right) + :label: eqnforceconstantswitch Because of the time averaging, we can no longer speak of a distance restraint potential. @@ -327,18 +326,17 @@ distance is within the bounds, otherwise the violation is the square root of the product of the instantaneous violation and the time averaged violation: -.. math:: - - \mathbf{F}_i~=~ \left\{ - \begin{array}{lclll} - k^a_{dr}\sqrt{(r_{ij}-r_0)(\bar{r}_{ij}-r_0)}\frac{\mathbf{r}_ij}{r_{ij}} - & \mbox{for} & r_{ij} < r_0 & \mbox{and} & \bar{r}_{ij} < r_0 \\[1.5ex] - -k^a _{dr} \, - \mbox{min}\left(\sqrt{(r_{ij}-r_1)(\bar{r}_{ij}-r_1)},r_2-r_1\right) - \frac{\mathbf{r}_ij}{r_{ij}} - & \mbox{for} & r_{ij} > r_1 & \mbox{and} & \bar{r}_{ij} > r_1 \\[1.5ex] - 0 &\mbox{otherwise} - \end{array} \right. +.. math:: \mathbf{F}_i~=~ \left\{ + \begin{array}{lclll} + k^a_{dr}\sqrt{(r_{ij}-r_0)(\bar{r}_{ij}-r_0)}\frac{\mathbf{r}_ij}{r_{ij}} + & \mbox{for} & r_{ij} < r_0 & \mbox{and} & \bar{r}_{ij} < r_0 \\[1.5ex] + -k^a _{dr} \, + \mbox{min}\left(\sqrt{(r_{ij}-r_1)(\bar{r}_{ij}-r_1)},r_2-r_1\right) + \frac{\mathbf{r}_ij}{r_{ij}} + & \mbox{for} & r_{ij} > r_1 & \mbox{and} & \bar{r}_{ij} > r_1 \\[1.5ex] + 0 &\mbox{otherwise} + \end{array} \right. + :label: eqntimeaverageviolation Averaging over multiple pairs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -381,26 +379,24 @@ heating of the protons. It is also possible to use *ensemble averaging* using multiple (protein) molecules. In this case the bounds should be lowered as in: -.. math:: - - \begin{array}{rcl} - r_1 &~=~& r_1 * M^{-1/6} \\ - r_2 &~=~& r_2 * M^{-1/6} - \end{array} +.. math:: \begin{array}{rcl} + r_1 &~=~& r_1 * M^{-1/6} \\ + r_2 &~=~& r_2 * M^{-1/6} + \end{array} + :label: eqnrestforceensembleaverage where :math:`M` is the number of molecules. The |Gromacs| preprocessor :ref:`grompp ` can do this automatically when the appropriate option is given. The resulting “distance” is then used to calculate the scalar force according to: -.. math:: - - \mathbf{F}_i~=~\left\{ - \begin{array}{rcl} - ~& 0 \hspace{4cm} & r_{N} < r_1 \\ - & k_{dr}(r_{N}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} & r_1 \le r_{N} < r_2 \\ - & k_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} & r_{N} \ge r_2 - \end{array} \right. +.. math:: \mathbf{F}_i~=~\left\{ + \begin{array}{rcl} + ~& 0 \hspace{4cm} & r_{N} < r_1 \\ + & k_{dr}(r_{N}-r_1)\frac{\mathbf{r}_ij}{r_{ij}} & r_1 \le r_{N} < r_2 \\ + & k_{dr}(r_2-r_1)\frac{\mathbf{r}_ij}{r_{ij}} & r_{N} \ge r_2 + \end{array} \right. + :label: eqnrestscalarforce where :math:`i` and :math:`j` denote the atoms of all the pairs that contribute to the NOE signal. @@ -462,6 +458,7 @@ examples of such orientation measurements are residual dipolar couplings vector :math:`\mathbf{r}_i` can be written as follows: .. math:: \delta_i = \frac{2}{3} \mbox{tr}({{\mathbf S}}{{\mathbf D}}_i) + :label: eqnorrestvector where :math:`{{\mathbf S}}` is the dimensionless order tensor of the molecule. The tensor :math:`{{\mathbf D}}_i` is given by: @@ -474,18 +471,18 @@ molecule. The tensor :math:`{{\mathbf D}}_i` is given by: \end{array} \right) :label: eqnorientdef -.. math:: - - \mbox{with:} \quad - x=\frac{r_{i,x}}{\|\mathbf{r}_i\|}, \quad - y=\frac{r_{i,y}}{\|\mathbf{r}_i\|}, \quad - z=\frac{r_{i,z}}{\|\mathbf{r}_i\|} +.. math:: \mbox{with:} \quad + x=\frac{r_{i,x}}{\|\mathbf{r}_i\|}, \quad + y=\frac{r_{i,y}}{\|\mathbf{r}_i\|}, \quad + z=\frac{r_{i,z}}{\|\mathbf{r}_i\|} + :label: eqnorientdef2 For a dipolar coupling :math:`\mathbf{r}_i` is the vector connecting the two nuclei, :math:`\alpha=3` and the constant :math:`c_i` is given by: .. math:: c_i = \frac{\mu_0}{4\pi} \gamma_1^i \gamma_2^i \frac{\hbar}{4\pi} + :label: eqnorrestconstant where :math:`\gamma_1^i` and :math:`\gamma_2^i` are the gyromagnetic ratios of the two nuclei. @@ -494,13 +491,12 @@ The order tensor is symmetric and has trace zero. Using a rotation matrix :math:`{\mathbf T}` it can be transformed into the following form: -.. math:: - - {\mathbf T}^T {{\mathbf S}}{\mathbf T} = s \left( \begin{array}{ccc} - -\frac{1}{2}(1-\eta) & 0 & 0 \\ - 0 & -\frac{1}{2}(1+\eta) & 0 \\ - 0 & 0 & 1 - \end{array} \right) +.. math:: {\mathbf T}^T {{\mathbf S}}{\mathbf T} = s \left( \begin{array}{ccc} + -\frac{1}{2}(1-\eta) & 0 & 0 \\ + 0 & -\frac{1}{2}(1+\eta) & 0 \\ + 0 & 0 & 1 + \end{array} \right) + :label: eqnorresttensor where :math:`-1 \leq s \leq 1` and :math:`0 \leq \eta \leq 1`. :math:`s` is called the order parameter and :math:`\eta` the asymmetry @@ -527,6 +523,7 @@ the structure is taken from the first subsystem. The calculated The calculated orientation for vector :math:`i` is given by: .. math:: \delta^c_i(t) = \frac{2}{3} \mbox{tr}({{\mathbf S}}(t){{\mathbf D}}_i^c(t)) + :label: eqnDrotvector The order tensor :math:`{{\mathbf S}}(t)` is usually unknown. A reasonable choice for the order tensor is the tensor which minimizes the @@ -557,19 +554,19 @@ molecule, the tensor can be averaged in an axis system that rotates with the molecule, as expressed by :eq:`equation %s `). The time-averaged tensors are calculated using an exponentially decaying memory function: -.. math:: - - {{\mathbf D}}^a_i(t) = \frac{\displaystyle - \int_{u=t_0}^t {{\mathbf D}}^c_i(u) \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u - }{\displaystyle - \int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u - } +.. math:: {{\mathbf D}}^a_i(t) = \frac{\displaystyle + \int_{u=t_0}^t {{\mathbf D}}^c_i(u) \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u + }{\displaystyle + \int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u + } + :label: eqnorresttimeaverage Assuming that the order tensor :math:`{{\mathbf S}}` fluctuates slower than the :math:`{{\mathbf D}}_i`, the time-averaged orientation can be calculated as: .. math:: \delta_i^a(t) = \frac{2}{3} \mbox{tr}({{\mathbf S}}(t) {{\mathbf D}}_i^a(t)) + :label: eqnorresttimeaveorient where the order tensor :math:`{{\mathbf S}}(t)` is calculated using expression :eq:`%s ` with :math:`\delta_i^c(t)` replaced by @@ -584,6 +581,7 @@ experimental orientations. When no time averaging is applied, a proper potential can be defined as: .. math:: V = \frac{1}{2} k \sum_{i=1}^N w_i (\delta_i^c (t) -\delta_i^{exp})^2 + :label: eqnorrestsimrest where the unit of :math:`k` is the unit of energy. Thus the effective force constant for restraint :math:`i` is :math:`k w_i`. The forces are @@ -591,14 +589,13 @@ given by minus the gradient of :math:`V`. The force :math:`\mathbf{F}\!_i` working on vector :math:`\mathbf{r}_i` is: -.. math:: - - \begin{aligned} - \mathbf{F}\!_i(t) - & = & - \frac{\mbox{d} V}{\mbox{d}\mathbf{r}_i} \\ - & = & -k w_i (\delta_i^c (t) -\delta_i^{exp}) \frac{\mbox{d} \delta_i (t)}{\mbox{d}\mathbf{r}_i} \\ - & = & -k w_i (\delta_i^c (t) -\delta_i^{exp}) - \frac{2 c_i}{\|\mathbf{r}\|^{2+\alpha}} \left(2 {{\mathbf R}}^T {{\mathbf S}}{{\mathbf R}}\mathbf{r}_i - \frac{2+\alpha}{\|\mathbf{r}\|^2} \mbox{tr}({{\mathbf R}}^T {{\mathbf S}}{{\mathbf R}}\mathbf{r}_i \mathbf{r}_i^T) \mathbf{r}_i \right)\end{aligned} +.. math:: \begin{aligned} + \mathbf{F}\!_i(t) + & = & - \frac{\mbox{d} V}{\mbox{d}\mathbf{r}_i} \\ + & = & -k w_i (\delta_i^c (t) -\delta_i^{exp}) \frac{\mbox{d} \delta_i (t)}{\mbox{d}\mathbf{r}_i} \\ + & = & -k w_i (\delta_i^c (t) -\delta_i^{exp}) + \frac{2 c_i}{\|\mathbf{r}\|^{2+\alpha}} \left(2 {{\mathbf R}}^T {{\mathbf S}}{{\mathbf R}}\mathbf{r}_i - \frac{2+\alpha}{\|\mathbf{r}\|^2} \mbox{tr}({{\mathbf R}}^T {{\mathbf S}}{{\mathbf R}}\mathbf{r}_i \mathbf{r}_i^T) \mathbf{r}_i \right)\end{aligned} + :label: eqnorrestsimrestforce Ensemble averaging ^^^^^^^^^^^^^^^^^^ @@ -608,18 +605,16 @@ subsystems that each contain an identical set of orientation restraints. The systems only interact via the orientation restraint potential which is defined as: -.. math:: - - V = M \frac{1}{2} k \sum_{i=1}^N w_i - \langle \delta_i^c (t) -\delta_i^{exp} \rangle^2 +.. math:: V = M \frac{1}{2} k \sum_{i=1}^N w_i + \langle \delta_i^c (t) -\delta_i^{exp} \rangle^2 + :label: eqnorrestensembleave The force on vector :math:`\mathbf{r}_{i,m}` in subsystem :math:`m` is given by: -.. math:: - - \mathbf{F}\!_{i,m}(t) = - \frac{\mbox{d} V}{\mbox{d}\mathbf{r}_{i,m}} = - -k w_i \langle \delta_i^c (t) -\delta_i^{exp} \rangle \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\mathbf{r}_{i,m}} \\ +.. math:: \mathbf{F}\!_{i,m}(t) = - \frac{\mbox{d} V}{\mbox{d}\mathbf{r}_{i,m}} = + -k w_i \langle \delta_i^c (t) -\delta_i^{exp} \rangle \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\mathbf{r}_{i,m}} + :label: eqnorrestensaveforce Time averaging ^^^^^^^^^^^^^^ @@ -628,41 +623,37 @@ When using time averaging it is not possible to define a potential. We can still define a quantity that gives a rough idea of the energy stored in the restraints: -.. math:: - - V = M \frac{1}{2} k^a \sum_{i=1}^N w_i - \langle \delta_i^a (t) -\delta_i^{exp} \rangle^2 +.. math:: V = M \frac{1}{2} k^a \sum_{i=1}^N w_i + \langle \delta_i^a (t) -\delta_i^{exp} \rangle^2 + :label: eqntimeavepot The force constant :math:`k_a` is switched on slowly to compensate for the lack of history at times close to :math:`t_0`. It is exactly proportional to the amount of average that has been accumulated: -.. math:: - - k^a = - k \, \frac{1}{\tau}\int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u +.. math:: k^a = + k \, \frac{1}{\tau}\int_{u=t_0}^t \exp\left(-\frac{t-u}{\tau}\right)\mbox{d} u + :label: eqntimeaveforceswitch What really matters is the definition of the force. It is chosen to be proportional to the square root of the product of the time-averaged and the instantaneous deviation. Using only the time-averaged deviation induces large oscillations. The force is given by: -.. math:: - - \mathbf{F}\!_{i,m}(t) = - \left\{ \begin{array}{ll} - 0 & \quad \mbox{for} \quad a\, b \leq 0 \\ - \displaystyle - k^a w_i \frac{a}{|a|} \sqrt{a\, b} \, \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\mathbf{r}_{i,m}} - & \quad \mbox{for} \quad a\, b > 0 - \end{array} - \right. - -.. math:: +.. math:: \mathbf{F}\!_{i,m}(t) = + \left\{ \begin{array}{ll} + 0 & \quad \mbox{for} \quad a\, b \leq 0 \\ + \displaystyle + k^a w_i \frac{a}{|a|} \sqrt{a\, b} \, \frac{\mbox{d} \delta_{i,m}^c (t)}{\mbox{d}\mathbf{r}_{i,m}} + & \quad \mbox{for} \quad a\, b > 0 + \end{array} + \right. + :label: eqntimeaveforce - \begin{aligned} - a &=& \langle \delta_i^a (t) -\delta_i^{exp} \rangle \\ - b &=& \langle \delta_i^c (t) -\delta_i^{exp} \rangle\end{aligned} +.. math:: \begin{aligned} + a &=& \langle \delta_i^a (t) -\delta_i^{exp} \rangle \\ + b &=& \langle \delta_i^c (t) -\delta_i^{exp} \rangle\end{aligned} + :label: eqntimeaveforce2 Using orientation restraints ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference-manual/introduction.rst b/docs/reference-manual/introduction.rst index d790db1d47..8dd4b752c0 100644 --- a/docs/reference-manual/introduction.rst +++ b/docs/reference-manual/introduction.rst @@ -105,11 +105,13 @@ MD simulations solve Newton’s equations of motion for a system of :math:`N` interacting atoms: .. math:: m_i \frac{\partial^2 \mathbf{r}_i}{\partial t^2} = \mathbf{F}_i, \;i=1 \ldots N. + :label: eqnnewtonslaws The forces are the negative derivatives of a potential function :math:`V(\mathbf{r}_1, \mathbf{r}_2, \ldots, \mathbf{r}_N)`: .. math:: \mathbf{F}_i = - \frac{\partial V}{\partial \mathbf{r}_i} + :label: eqnmdforces The equations are solved simultaneously in small time steps. The system is followed for some time, taking care that the temperature and pressure @@ -142,15 +144,13 @@ of the simulation. We list the approximations below. appreciably from that of a real quantum oscillator when the resonance frequency :math:`\nu` approximates or exceeds :math:`k_BT/h`. Now at room temperature the wavenumber - :math:`\sigma = 1/\lambda = - \nu/c` at which :math:`h + :math:`\sigma = 1/\lambda = \nu/c` at which :math:`h \nu = k_BT` is approximately 200 cm\ :math:`^{-1}`. Thus, all frequencies higher than, say, 100 cm\ :math:`^{-1}` may misbehave in classical simulations. This means that practically all bond and bond-angle vibrations are suspect, and even hydrogen-bonded motions as translational or librational H-bond vibrations are - beyond the classical limit (see - :numref:`Table %s `) + beyond the classical limit (see :numref:`Table %s `) What can we do? .. |H2CX| replace:: H\ :math:`_2`\ CX @@ -199,13 +199,11 @@ of the simulation. We list the approximations below. heat of a one-dimensional oscillator with frequency :math:`\nu` are: \ :ref:`11 ` - .. math:: + .. math:: U^{QM} = U^{cl} +kT \left( {\frac{1}{2}}x - 1 + \frac{x}{e^x-1} \right) + :label: eqnmdqmcorr - U^{QM} = U^{cl} +kT \left( {\frac{1}{2}}x - 1 + \frac{x}{e^x-1} \right) - - .. math:: - - C_V^{QM} = C_V^{cl} + k \left( \frac{x^2e^x}{(e^x-1)^2} - 1 \right) + .. math:: C_V^{QM} = C_V^{cl} + k \left( \frac{x^2e^x}{(e^x-1)^2} - 1 \right) + :label: eqnmdqmcorr2 where :math:`x=h\nu /kT`. The classical oscillator absorbs too much energy (:math:`kT`), while the high-frequency quantum diff --git a/docs/reference-manual/special/awh.rst b/docs/reference-manual/special/awh.rst index e02290a456..fb17a1d606 100644 --- a/docs/reference-manual/special/awh.rst +++ b/docs/reference-manual/special/awh.rst @@ -25,6 +25,7 @@ coordinate :math:`\xi(x)` is coupled to :math:`\lambda` with a harmonic potential .. math:: Q(\xi,\lambda) = \frac{1}{2} \beta k (\xi - \lambda)^2, + :label: eqnawhbasic so that for large force constants :math:`k`, :math:`\xi \approx \lambda`. Note the use of dimensionless energies for @@ -104,6 +105,7 @@ free energy update that has the same form but which can be applied repeatedly with limited and localized sampling, .. math:: \Delta F_n = -\ln \frac{W_n(\lambda) + \sum_t \omega_n(\lambda|x(t))}{W_n(\lambda) + \sum_t\rho_n(\lambda)) }. + :label: eqnawhsampling Here :math:`W_n(\lambda)` is the *reference weight histogram* representing prior sampling. The update for :math:`W(\lambda)`, @@ -333,6 +335,7 @@ The target distribution :math:`\rho(\lambda)` is traditionally chosen to be uniform .. math:: \rho_{\mathrm{const}}(\lambda) = \mathrm{const.} + :label: eqnawhuniformdist This choice exactly flattens :math:`F(\lambda)` in user-defined sampling interval :math:`I`. Generally, @@ -379,11 +382,13 @@ considering. In this case :math:`\rho` is a function of the reference weight histogram .. math:: \rho_{\mathrm{Boltz,loc}}(\lambda) \propto W(\lambda), + :label: eqnawhweighthistogram and the update of the weight histogram is modified (cf. :eq:`Eq. %s `) .. math:: W_{n+1}(\lambda) = W_{n}(\lambda) + s_{\beta}\sum_t \omega(\lambda | x(t)). + :label: eqnawhupdateweighthist Thus, here the weight histogram equals the real history of samples, but scaled by :math:`s_\beta`. This target distribution is called *local* @@ -405,6 +410,7 @@ Lastly, the target distribution can be modulated by arbitrary probability weights .. math:: \rho(\lambda) = \rho_0(\lambda) w_{\mathrm{user}}(\lambda). + :label: eqnawhpropweigth where :math:`w_{\mathrm{user}}(\lambda)` is provided by user data and in principle :math:`\rho_0(\lambda)` can be any of the target diff --git a/docs/reference-manual/special/comp-electrophys.rst b/docs/reference-manual/special/comp-electrophys.rst index a9bc0c5c54..ba73b3bc52 100644 --- a/docs/reference-manual/special/comp-electrophys.rst +++ b/docs/reference-manual/special/comp-electrophys.rst @@ -12,6 +12,7 @@ membrane, which gives rise to a potential difference :math:`\Delta U` according to the membrane capacitance: .. math:: \Delta U = \Delta q / C_{membrane} + :label: eqnmembcap The transmembrane electric field and concentration gradients are controlled by :ref:`mdp` options, which allow the user to set @@ -55,6 +56,7 @@ average channel conductance :math:`G` in each interval :math:`\Delta t` is determined by: .. math:: G = \frac{\sum_{i} n_{i}q_{i}}{\Delta t \, \Delta U} \, . + :label: eqnchannelcond The ion selectivity is calculated as the number flux ratio of different species. Best results are obtained by averaging these values over diff --git a/docs/reference-manual/special/enforced-rotation.rst b/docs/reference-manual/special/enforced-rotation.rst index 8c85c88780..9fb8158dcf 100644 --- a/docs/reference-manual/special/enforced-rotation.rst +++ b/docs/reference-manual/special/enforced-rotation.rst @@ -78,16 +78,15 @@ with optional mass-weighted prefactors :math:`w_i = N \, m_i/M` with total mass :math:`M = \sum_{i=1}^N m_i`. The rotation matrix :math:`\mathbf{\Omega}(t)` is -.. math:: - - \mathbf{\Omega}(t) = - \left( - \begin{array}{ccc} - \cos\omega t + v_x^2{\,\xi\,}& v_x v_y{\,\xi\,}- v_z\sin\omega t & v_x v_z{\,\xi\,}+ v_y\sin\omega t\\ - v_x v_y{\,\xi\,}+ v_z\sin\omega t & \cos\omega t + v_y^2{\,\xi\,}& v_y v_z{\,\xi\,}- v_x\sin\omega t\\ - v_x v_z{\,\xi\,}- v_y\sin\omega t & v_y v_z{\,\xi\,}+ v_x\sin\omega t & \cos\omega t + v_z^2{\,\xi\,}\\ - \end{array} - \right) +.. math:: \mathbf{\Omega}(t) = + \left( + \begin{array}{ccc} + \cos\omega t + v_x^2{\,\xi\,}& v_x v_y{\,\xi\,}- v_z\sin\omega t & v_x v_z{\,\xi\,}+ v_y\sin\omega t\\ + v_x v_y{\,\xi\,}+ v_z\sin\omega t & \cos\omega t + v_y^2{\,\xi\,}& v_y v_z{\,\xi\,}- v_x\sin\omega t\\ + v_x v_z{\,\xi\,}- v_y\sin\omega t & v_y v_z{\,\xi\,}+ v_x\sin\omega t & \cos\omega t + v_z^2{\,\xi\,}\\ + \end{array} + \right) + :label: eqnrotmat where :math:`v_x`, :math:`v_y`, and :math:`v_z` are the components of the normalized rotation vector :math:`\hat{\mathbf{v}}`, @@ -145,17 +144,15 @@ The forces generated by the isotropic potentials (eqns. :eq:`%s ` and :eq:`%s `) also contain components parallel to the rotation axis and thereby restrain motions along the axis of either the whole rotation group (in case of :math:`V^\mathrm{iso}`) or within the -rotation group, in case of - -.. math:: V^\mathrm{iso-pf} +rotation group, in case of :math:`V^\mathrm{iso-pf}`. -For cases where -unrestrained motion along the axis is preferred, we have implemented a +For cases where unrestrained motion along the axis is preferred, we have implemented a “parallel motion” variant by eliminating all components parallel to the rotation axis for the potential. This is achieved by projecting the distance vectors between reference and actual positions .. math:: \mathbf{r}_i = \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{u}) - (\mathbf{x}_i - \mathbf{u}) + :label: eqnrotdistvectors onto the plane perpendicular to the rotation vector, @@ -191,6 +188,7 @@ Replacing in eqn. :eq:`%s ` the fixed pivot parallel motion potential. With .. math:: \mathbf{s}_i = \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{y}_c^0) - (\mathbf{x}_i - \mathbf{x}_c) + :label: eqnparrallelpotential the respective potential and forces are @@ -225,10 +223,9 @@ rotation axis, with -.. math:: - - \mathbf{p}_i := - \frac{\hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{u})} {\| \hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{u})\|} \ . +.. math:: \mathbf{p}_i := + \frac{\hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{u})} {\| \hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{u})\|} \ . + :label: eqnpotrmpart2 This variant depends only on the distance :math:`\mathbf{p}_i \cdot (\mathbf{x}_i - @@ -247,10 +244,9 @@ Pivot-Free Radial Motion Potential Proceeding similar to the pivot-free isotropic potential yields a pivot-free version of the above potential. With -.. math:: - - \mathbf{q}_i := - \frac{\hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{y}_c^0)} {\| \hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{y}_c^0)\|} \, , +.. math:: \mathbf{q}_i := + \frac{\hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{y}_c^0)} {\| \hat{\mathbf{v}}\times \mathbf{\Omega}(t) (\mathbf{y}_i^0 - \mathbf{y}_c^0)\|} \, , + :label: eqnpotrmpfpart1 the potential and force for the pivot-free variant of the radial motion potential read @@ -305,16 +301,15 @@ continuous forces also close to the rotation axis, which is not the case for :math:`\epsilon'\mathrm{ = }0\mathrm{nm}^2` (:numref:`Fig. %s C `). With -.. math:: - - \begin{aligned} - \mathbf{r}_i & := & \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{u})\\ - \mathbf{s}_i & := & \frac{\hat{\mathbf{v}} \times (\mathbf{x}_i - - \mathbf{u} ) }{ \| \hat{\mathbf{v}} \times (\mathbf{x}_i - \mathbf{u}) - \| } \equiv \; \Psi_{i} \;\; {\hat{\mathbf{v}} \times - (\mathbf{x}_i-\mathbf{u} ) }\\ - \Psi_i^{*} & := & \frac{1}{ \| \hat{\mathbf{v}} \times - (\mathbf{x}_i-\mathbf{u}) \|^2 + \epsilon'}\end{aligned} +.. math:: \begin{aligned} + \mathbf{r}_i & := & \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{u})\\ + \mathbf{s}_i & := & \frac{\hat{\mathbf{v}} \times (\mathbf{x}_i - + \mathbf{u} ) }{ \| \hat{\mathbf{v}} \times (\mathbf{x}_i - \mathbf{u}) + \| } \equiv \; \Psi_{i} \;\; {\hat{\mathbf{v}} \times + (\mathbf{x}_i-\mathbf{u} ) }\\ + \Psi_i^{*} & := & \frac{1}{ \| \hat{\mathbf{v}} \times + (\mathbf{x}_i-\mathbf{u}) \|^2 + \epsilon'}\end{aligned} + :label: eqnpotrm2forcepart1 the force on atom :math:`j` reads @@ -343,15 +338,14 @@ The pivot-free variant of the above potential is With -.. math:: - - \begin{aligned} - \mathbf{r}_i & := & \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c)\\ - \mathbf{s}_i & := & \frac{\hat{\mathbf{v}} \times (\mathbf{x}_i - - \mathbf{x}_c ) }{ \| \hat{\mathbf{v}} \times (\mathbf{x}_i - \mathbf{x}_c) - \| } \equiv \; \Psi_{i} \;\; {\hat{\mathbf{v}} \times - (\mathbf{x}_i-\mathbf{x}_c ) }\\ \Psi_i^{*} & := & \frac{1}{ \| \hat{\mathbf{v}} \times - (\mathbf{x}_i-\mathbf{x}_c) \|^2 + \epsilon'}\end{aligned} +.. math:: \begin{aligned} + \mathbf{r}_i & := & \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c)\\ + \mathbf{s}_i & := & \frac{\hat{\mathbf{v}} \times (\mathbf{x}_i - + \mathbf{x}_c ) }{ \| \hat{\mathbf{v}} \times (\mathbf{x}_i - \mathbf{x}_c) + \| } \equiv \; \Psi_{i} \;\; {\hat{\mathbf{v}} \times + (\mathbf{x}_i-\mathbf{x}_c ) }\\ \Psi_i^{*} & := & \frac{1}{ \| \hat{\mathbf{v}} \times + (\mathbf{x}_i-\mathbf{x}_c) \|^2 + \epsilon'}\end{aligned} + :label: eqnpotrm2pfpart2 the force on atom :math:`j` reads @@ -404,6 +398,7 @@ is the width of the Gaussian function, :math:`\Delta x` the distance between adjacent slabs, and .. math:: \beta_n(\mathbf{x}_i) := \mathbf{x}_i \cdot \hat{\mathbf{v}} - n \, \Delta x \, . + :label: eqngaussianpart2 .. _fig-gaussian: @@ -417,12 +412,11 @@ between adjacent slabs, and A most convenient choice is :math:`\sigma = 0.7 \Delta x` and -.. math:: - - 1/\Gamma = \sum_{n \in Z} - \mbox{exp} - \left(-\frac{(n - \frac{1}{4})^2}{2\cdot 0.7^2}\right) - \approx 1.75464 \, , +.. math:: 1/\Gamma = \sum_{n \in Z} + \mbox{exp} + \left(-\frac{(n - \frac{1}{4})^2}{2\cdot 0.7^2}\right) + \approx 1.75464 \, , + :label: eqngaussianpart3 which yields a nearly constant sum, essentially independent of :math:`\mathbf{x}_i` (dashed line in @@ -491,13 +485,12 @@ used in eqn. :eq:`%s ` is now replaced by :math:`\mathbf{x}_c^n`, the center of mass of the slab. With -.. math:: - - \begin{aligned} - \mathbf{q}_i^n & := & \frac{\hat{\mathbf{v}} \times - \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c^n) }{ \| \hat{\mathbf{v}} - \times \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c^n) \| } \\ - b_i^n & := & \mathbf{q}_i^n \cdot (\mathbf{x}_i - \mathbf{x}_c^n) \, ,\end{aligned} +.. math:: \begin{aligned} + \mathbf{q}_i^n & := & \frac{\hat{\mathbf{v}} \times + \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c^n) }{ \| \hat{\mathbf{v}} + \times \mathbf{\Omega}(t)(\mathbf{y}_i^0 - \mathbf{y}_c^n) \| } \\ + b_i^n & := & \mathbf{q}_i^n \cdot (\mathbf{x}_i - \mathbf{x}_c^n) \, ,\end{aligned} + :label: eqnflexpotpart2 the resulting force on atom :math:`j` reads @@ -552,13 +545,8 @@ assume :math:`\mathbf{x}_c` to be constant, and thus \partial \mathbf{x}_c / \partial y = \partial \mathbf{x}_c / \partial z = 0`. The resulting force error is small (of order :math:`O(1/N)` or :math:`O(m_j/M)` if mass-weighting is applied) and can therefore be -tolerated. With this assumption, the forces - -.. math:: - \mathbf{F}^\mathrm{flex-t} - -have the same form as -eqn. :eq:`%s `. +tolerated. With this assumption, the forces :math:`\mathbf{F}^\mathrm{flex-t}` +have the same form as eqn. :eq:`%s `. Flexible Axis 2 Alternative Potential ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -796,12 +784,11 @@ rotation axis through pivot point :math:`\mathbf{u}` (see eqn. :eq:`%s ` for the definition of :math:`\perp`), -.. math:: - - \cos \theta_i = - \frac{(\mathbf{y}_i-\mathbf{u})^\perp \cdot (\mathbf{x}_i-\mathbf{u})^\perp} - { \| (\mathbf{y}_i-\mathbf{u})^\perp \cdot (\mathbf{x}_i-\mathbf{u})^\perp - \| } \ . +.. math:: \cos \theta_i = + \frac{(\mathbf{y}_i-\mathbf{u})^\perp \cdot (\mathbf{x}_i-\mathbf{u})^\perp} + { \| (\mathbf{y}_i-\mathbf{u})^\perp \cdot (\mathbf{x}_i-\mathbf{u})^\perp + \| } \ . + :label: eqnavanglepart2 The sign of :math:`\theta_\mathrm{av}` is chosen such that :math:`\theta_\mathrm{av} > 0` if the actual structure rotates ahead of diff --git a/docs/reference-manual/special/free-energy-implementation.rst b/docs/reference-manual/special/free-energy-implementation.rst index aa52768a93..9dcd4d4b62 100644 --- a/docs/reference-manual/special/free-energy-implementation.rst +++ b/docs/reference-manual/special/free-energy-implementation.rst @@ -87,10 +87,12 @@ To compute free energies with a vector :math:`\lambda` using thermodynamic integration, then the TI equation becomes vector equation: .. math:: \Delta F = \int \langle \nabla H \rangle \cdot d\vec{\lambda} + :label: eqnfepti or for finite differences: .. math:: \Delta F \approx \int \sum \langle \nabla H \rangle \cdot \Delta\lambda + :label: eqnfepfinitediff The external `pymbar script `_ can compute this integral automatically @@ -134,6 +136,7 @@ groups \ :ref:`134 `. For a system of two non-interacting masses the potential of mean force is: .. math:: V_{pmf}(r) = -(n_c - 1) k_B T \log(r) + :label: eqnfepentropy where :math:`n_c` is the number of dimensions in which the constraint works (i.e. :math:`n_c=3` for a normal constraint and :math:`n_c=1` when diff --git a/docs/reference-manual/special/pulling.rst b/docs/reference-manual/special/pulling.rst index 2a08303fbc..1d481a8b2c 100644 --- a/docs/reference-manual/special/pulling.rst +++ b/docs/reference-manual/special/pulling.rst @@ -110,12 +110,11 @@ axis along this one dimension. To avoid jumps in the pull force, contributions of atoms are weighted as a function of distance (in addition to the mass weighting): -.. math:: - - \begin{aligned} - w(r < r_\mathrm{cyl}) & = & - 1-2 \left(\frac{r}{r_\mathrm{cyl}}\right)^2 + \left(\frac{r}{r_\mathrm{cyl}}\right)^4 \\ - w(r \geq r_\mathrm{cyl}) & = & 0\end{aligned} +.. math:: \begin{aligned} + w(r < r_\mathrm{cyl}) & = & + 1-2 \left(\frac{r}{r_\mathrm{cyl}}\right)^2 + \left(\frac{r}{r_\mathrm{cyl}}\right)^4 \\ + w(r \geq r_\mathrm{cyl}) & = & 0\end{aligned} + :label: eqnpulldistmassweight Note that the radial dependence on the weight causes a radial force on both cylinder group and the other pull group. This is an undesirable, @@ -156,19 +155,20 @@ either by supplying weights in the input or due to cylinder geometry or due to cosine weighting, the weights need to be scaled to conserve momentum: -.. math:: - - w'_i = w_i - \left. \sum_{j=1}^N w_j \, m_j \right/ \sum_{j=1}^N w_j^2 \, m_j +.. math:: w'_i = w_i + \left. \sum_{j=1}^N w_j \, m_j \right/ \sum_{j=1}^N w_j^2 \, m_j + :label: eqnpullmassscale where :math:`m_j` is the mass of atom :math:`j` of the group. The mass of the group, required for calculating the constraint force, is: .. math:: M = \sum_{i=1}^N w'_i \, m_i + :label: eqnpullconstraint The definition of the weighted center of mass is: .. math:: \mathbf{r}_{com} = \left. \sum_{i=1}^N w'_i \, m_i \, \mathbf{r}_i \right/ M + :label: eqnpullcom From the centers of mass the AFM, constraint, or umbrella force :math:`\mathbf{F}_{\!com}` on each group can be @@ -176,6 +176,7 @@ calculated. The force on the center of mass of a group is redistributed to the atoms as follows: .. math:: \mathbf{F}_{\!i} = \frac{w'_i \, m_i}{M} \, \mathbf{F}_{\!com} + :label: eqnpullcomforce Definition of the pull direction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/reference-manual/special/qmmm.rst b/docs/reference-manual/special/qmmm.rst index 10a5ea8ac4..e4a32ebf00 100644 --- a/docs/reference-manual/special/qmmm.rst +++ b/docs/reference-manual/special/qmmm.rst @@ -44,7 +44,7 @@ subsystems are supported in this version: H^{QM/MM} = H^{QM}_e-\sum_i^n\sum_J^M\frac{e^2Q_J}{4\pi\epsilon_0r_{iJ}}+\sum_A^N\sum_J^M\frac{e^2Z_AQ_J}{e\pi\epsilon_0R_{AJ}}, -# where :math:`n` and :math:`N` are the number of electrons and nuclei + where :math:`n` and :math:`N` are the number of electrons and nuclei in the QM region, respectively, and :math:`M` is the number of charged MM atoms. The first term on the right hand side is the original electronic Hamiltonian of an isolated QM system. The first @@ -75,7 +75,7 @@ subsystems are supported in this version: E_{tot} = E_{I}^{QM} +E_{I+II}^{MM}-E_{I}^{MM}, -# where the subscripts I and II refer to the QM and MM subsystems, + where the subscripts I and II refer to the QM and MM subsystems, respectively. The superscripts indicate at what level of theory the energies are computed. The ONIOM scheme has the advantage that it is not restricted to a two-layer QM/MM description, but can easily diff --git a/docs/reference-manual/special/tabulated-interaction-functions.rst b/docs/reference-manual/special/tabulated-interaction-functions.rst index 2ec7673834..71ea7efaec 100644 --- a/docs/reference-manual/special/tabulated-interaction-functions.rst +++ b/docs/reference-manual/special/tabulated-interaction-functions.rst @@ -19,32 +19,29 @@ spline interpolation for :math:`x_i \leq x < x_{i+1}` looks like this: where the table spacing :math:`h` and fraction :math:`\epsilon` are given by: -.. math:: - - \begin{aligned} - h &=& x_{i+1} - x_i \\ - \epsilon&=& (x - x_i)/h\end{aligned} +.. math:: \begin{aligned} + h &=& x_{i+1} - x_i \\ + \epsilon&=& (x - x_i)/h\end{aligned} + :label: eqntablespaceing so that :math:`0 \le \epsilon < 1`. From this, we can calculate the derivative in order to determine the forces: -.. math:: - - -V_s'(x) ~=~ - -\frac{{\rm d}V_s(x)}{{\rm d}\epsilon}\frac{{\rm d}\epsilon}{{\rm d}x} ~=~ - -(A_1 + 2 A_2 \,\epsilon + 3 A_3 \,\epsilon^2)/h +.. math:: -V_s'(x) ~=~ + -\frac{{\rm d}V_s(x)}{{\rm d}\epsilon}\frac{{\rm d}\epsilon}{{\rm d}x} ~=~ + -(A_1 + 2 A_2 \,\epsilon + 3 A_3 \,\epsilon^2)/h + :label: eqntablederivative The four coefficients are determined from the four conditions that :math:`V_s` and :math:`-V_s'` at both ends of each interval should match the exact potential :math:`V` and force :math:`-V'`. This results in the following errors for each interval: -.. math:: - - \begin{aligned} - | V_s - V | _{max} &=& V'''' \frac{h^4}{384} + O(h^5) \\ - | V_s' - V' | _{max} &=& V'''' \frac{h^3}{72\sqrt{3}} + O(h^4) \\ - | V_s''- V''| _{max} &=& V'''' \frac{h^2}{12} + O(h^3)\end{aligned} +.. math:: \begin{aligned} + | V_s - V | _{max} &=& V'''' \frac{h^4}{384} + O(h^5) \\ + | V_s' - V' | _{max} &=& V'''' \frac{h^3}{72\sqrt{3}} + O(h^4) \\ + | V_s''- V''| _{max} &=& V'''' \frac{h^2}{12} + O(h^3)\end{aligned} + :label: eqntableerrors V and V’ are continuous, while V” is the first discontinuous derivative. The number of points per nanometer is 500 and 2000 for @@ -90,6 +87,7 @@ You can also use your own potential functions without editing the following equation .. math:: V(r_{ij}) ~=~ \frac{q_i q_j}{4 \pi\epsilon_0} f(r_{ij}) + C_6 \,g(r_{ij}) + C_{12} \,h(r_{ij}) + :label: eqnuserpotfunction where :math:`f`, :math:`g`, and :math:`h` are user defined functions. **Note** that if :math:`g(r)` represents a normal dispersion diff --git a/docs/reference-manual/special/viscosity-calculation.rst b/docs/reference-manual/special/viscosity-calculation.rst index a37c54b201..28ca909aa2 100644 --- a/docs/reference-manual/special/viscosity-calculation.rst +++ b/docs/reference-manual/special/viscosity-calculation.rst @@ -11,12 +11,11 @@ changes of molecules solvated in the liquid. The viscosity can be calculated from an equilibrium simulation using an Einstein relation: -.. math:: - - \eta = \frac{1}{2}\frac{V}{k_B T} \lim_{t \rightarrow \infty} - \frac{\mbox{d}}{\mbox{d} t} \left\langle - \left( \int_{t_0}^{{t_0}+t} P_{xz}(t') \mbox{d} t' \right)^2 - \right\rangle_{t_0} +.. math:: \eta = \frac{1}{2}\frac{V}{k_B T} \lim_{t \rightarrow \infty} + \frac{\mbox{d}}{\mbox{d} t} \left\langle + \left( \int_{t_0}^{{t_0}+t} P_{xz}(t') \mbox{d} t' \right)^2 + \right\rangle_{t_0} + :label: eqneinsteinrelation This can be done with :ref:`gmx energy `. This method converges very slowly \ :ref:`149 `, and as such a nanosecond simulation might not @@ -34,31 +33,34 @@ a Newtonian liquid adding a small force will result in a velocity gradient according to the following equation: .. math:: a_x(z) + \frac{\eta}{\rho} \frac{\partial^2 v_x(z)}{\partial z^2} = 0 + :label: eqnviscositygradiant Here we have applied an acceleration :math:`a_x(z)` in the :math:`x`-direction, which is a function of the :math:`z`-coordinate. In |Gromacs| the acceleration profile is: .. math:: a_x(z) = A \cos\left(\frac{2\pi z}{l_z}\right) + :label: eqnviscosityacceleration where :math:`l_z` is the height of the box. The generated velocity profile is: .. math:: v_x(z) = V \cos\left(\frac{2\pi z}{l_z}\right) + :label: eqnviscosityprofile1 .. math:: V = A \frac{\rho}{\eta}\left(\frac{l_z}{2\pi}\right)^2 + :label: eqnviscosityprofile2 The viscosity can be calculated from :math:`A` and :math:`V`: .. math:: \eta = \frac{A}{V}\rho \left(\frac{l_z}{2\pi}\right)^2 - :label: eqvisc + :label: eqnvisc In the simulation :math:`V` is defined as: -.. math:: - - V = \frac{\displaystyle \sum_{i=1}^N m_i v_{i,x} 2 \cos\left(\frac{2\pi z}{l_z}\right)} - {\displaystyle \sum_{i=1}^N m_i} +.. math:: V = \frac{\displaystyle \sum_{i=1}^N m_i v_{i,x} 2 \cos\left(\frac{2\pi z}{l_z}\right)} + {\displaystyle \sum_{i=1}^N m_i} + :label: eqnsimulationviscosity The generated velocity profile is not coupled to the heat bath. Moreover, the velocity profile is excluded from the kinetic energy. One @@ -67,10 +69,9 @@ However, the shear rate should not be so high that the system gets too far from equilibrium. The maximum shear rate occurs where the cosine is zero, the rate being: -.. math:: - - \mbox{sh}_{\max} = \max_z \left| \frac{\partial v_x(z)}{\partial z} \right| - = A \frac{\rho}{\eta} \frac{l_z}{2\pi} +.. math:: \mbox{sh}_{\max} = \max_z \left| \frac{\partial v_x(z)}{\partial z} \right| + = A \frac{\rho}{\eta} \frac{l_z}{2\pi} + :label: eqnshearrate For a simulation with: :math:`\eta=10^{-3}` [kgm:math:`^{-1}`\ s\ :math:`^{-1}`], @@ -93,6 +94,7 @@ shift \ :ref:`31 `, which can be written in terms of the shear rate as: .. math:: T_s = \frac{\eta\,\tau}{2 \rho\,C_v} \mbox{sh}_{\max}^2 + :label: eqnberendsentempshift where :math:`\tau` is the coupling time for the Berendsen thermostat and :math:`C_v` is the heat capacity. Using the values of the example @@ -108,5 +110,5 @@ of the correlation time of the liquid. Two quantities are written to the energy file, along with their averages and fluctuations: :math:`V` and :math:`1/\eta`, as obtained from -(:eq:`%s `). +(:eq:`%s `). diff --git a/docs/reference-manual/topologies/parameter-files.rst b/docs/reference-manual/topologies/parameter-files.rst index e1273597e2..c7d196df8b 100644 --- a/docs/reference-manual/topologies/parameter-files.rst +++ b/docs/reference-manual/topologies/parameter-files.rst @@ -65,22 +65,21 @@ column. The interpretation of the parameters V and W depends on the combination rule that was chosen in the ``[ defaults ]`` section of the topology file (see :ref:`topfile`): -.. math:: - - \begin{aligned} - \mbox{for combination rule 1}: & & - \begin{array}{llllll} - \mbox{V}_{ii} & = & C^{(6)}_{i} & = & 4\,\epsilon_i\sigma_i^{6} & - \mbox{[ kJ mol$^{-1}$ nm$^{6}$ ]}\\ - \mbox{W}_{ii} & = & C^{(12)}_{i} & = & 4\,\epsilon_i\sigma_i^{12} & - \mbox{[ kJ mol$^{-1}$ nm$^{12}$ ]}\\ - \end{array} - \\ - \mbox{for combination rules 2 and 3}: & & - \begin{array}{llll} - \mbox{V}_{ii} & = & \sigma_i & \mbox{[ nm ]} \\ - \mbox{W}_{ii} & = & \epsilon_i & \mbox{[ kJ mol$^{-1}$ ]} - \end{array}\end{aligned} +.. math:: \begin{aligned} + \mbox{for combination rule 1}: & & + \begin{array}{llllll} + \mbox{V}_{ii} & = & C^{(6)}_{i} & = & 4\,\epsilon_i\sigma_i^{6} & + \mbox{[ kJ mol$^{-1}$ nm$^{6}$ ]}\\ + \mbox{W}_{ii} & = & C^{(12)}_{i} & = & 4\,\epsilon_i\sigma_i^{12} & + \mbox{[ kJ mol$^{-1}$ nm$^{12}$ ]}\\ + \end{array} + \\ + \mbox{for combination rules 2 and 3}: & & + \begin{array}{llll} + \mbox{V}_{ii} & = & \sigma_i & \mbox{[ nm ]} \\ + \mbox{W}_{ii} & = & \epsilon_i & \mbox{[ kJ mol$^{-1}$ ]} + \end{array}\end{aligned} + :label: eqndefcombrule Some or all combinations for different atom types can be given in the ``[ nonbond_params ]`` section, again with parameters V and @@ -88,20 +87,19 @@ W as defined above. Any combination that is not given will be computed from the parameters for the corresponding atom types, according to the combination rule: -.. math:: - - \begin{aligned} - \mbox{for combination rules 1 and 3}: & & - \begin{array}{lll} - C^{(6)}_{ij} & = & \left(C^{(6)}_i\,C^{(6)}_j\right)^{\frac{1}{2}} \\ - C^{(12)}_{ij} & = & \left(C^{(12)}_i\,C^{(12)}_j\right)^{\frac{1}{2}} - \end{array} - \\ - \mbox{for combination rule 2}: & & - \begin{array}{lll} - \sigma_{ij} & = & \frac{1}{2}(\sigma_i+\sigma_j) \\ - \epsilon_{ij} & = & \sqrt{\epsilon_i\,\epsilon_j} - \end{array}\end{aligned} +.. math:: \begin{aligned} + \mbox{for combination rules 1 and 3}: & & + \begin{array}{lll} + C^{(6)}_{ij} & = & \left(C^{(6)}_i\,C^{(6)}_j\right)^{\frac{1}{2}} \\ + C^{(12)}_{ij} & = & \left(C^{(12)}_i\,C^{(12)}_j\right)^{\frac{1}{2}} + \end{array} + \\ + \mbox{for combination rule 2}: & & + \begin{array}{lll} + \sigma_{ij} & = & \frac{1}{2}(\sigma_i+\sigma_j) \\ + \epsilon_{ij} & = & \sqrt{\epsilon_i\,\epsilon_j} + \end{array}\end{aligned} + :label: eqngivencombrule When :math:`\sigma` and :math:`\epsilon` need to be supplied (rules 2 and 3), it would seem it is impossible to have a non-zero :math:`C^{12}` @@ -113,13 +111,12 @@ nothing more. There is only one set of combination rules for Buckingham potentials: -.. math:: - - \begin{array}{rcl} - A_{ij} &=& \left(A_{ii} \, A_{jj}\right)^{1/2} \\ - B_{ij} &=& 2 / \left(\frac{1}{B_{ii}} + \frac{1}{B_{jj}}\right) \\ - C_{ij} &=& \left(C_{ii} \, C_{jj}\right)^{1/2} - \end{array} +.. math:: \begin{array}{rcl} + A_{ij} &=& \left(A_{ii} \, A_{jj}\right)^{1/2} \\ + B_{ij} &=& 2 / \left(\frac{1}{B_{ii}} + \frac{1}{B_{jj}}\right) \\ + C_{ij} &=& \left(C_{ii} \, C_{jj}\right)^{1/2} + \end{array} + :label: eqnbuckinghamcombrule Bonded parameters ~~~~~~~~~~~~~~~~~ -- 2.22.0