All Pages
switchingfunction

Functions that measure whether values are less than a certain quantity. Functions that measure whether values are less than a certain quantity.

Switching functions \(s(r)\) take a minimum of one input parameter \(d_0\). For \(r \le d_0 \quad s(r)=1.0\) while for \(r > d_0\) the function decays smoothly to 0. The various switching functions available in plumed differ in terms of how this decay is performed.

Where there is an accepted convention in the literature (e.g. COORDINATION) on the form of the switching function we use the convention as the default. However, the flexibility to use different switching functions is always present generally through a single keyword. This keyword generally takes an input with the following form:

KEYWORD={TYPE <list of parameters>}

The following table contains a list of the various switching functions that are available in plumed 2 together with an example input.

TYPE FUNCTION EXAMPLE INPUT DEFAULT PARAMETERS
RATIONAL \( s(r)=\frac{ 1 - \left(\frac{ r - d_0 }{ r_0 }\right)^{n} }{ 1 - \left(\frac{ r - d_0 }{ r_0 }\right)^{m} } \) {RATIONAL R_0= \(r_0\) D_0= \(d_0\) NN= \(n\) MM= \(m\)} \(d_0=0.0\), \(n=6\), \(m=12\)
EXP \( s(r)=\exp\left(-\frac{ r - d_0 }{ r_0 }\right) \) {EXP R_0= \(r_0\) D_0= \(d_0\)} \(d_0=0.0\)
GAUSSIAN \( s(r)=\exp\left(-\frac{ (r - d_0)^2 }{ 2r_0^2 }\right) \) {GAUSSIAN R_0= \(r_0\) D_0= \(d_0\)} \(d_0=0.0\)
SMAP \( s(r) = \left[ 1 + ( 2^{a/b} -1 )\left( \frac{r-d_0}{r_0} \right)\right]^{-b/a} \) {SMAP R_0= \(r_0\) D_0= \(d_0\) A= \(a\) B= \(b\)} \(d_0=0.0\)

For all the switching functions in the above table one can also specify a further (optional) parameter using the parameter keyword D_MAX to assert that for \(r>d_{\textrm{max}}\) the switching function can be assumed equal to zero. In this case it is suggested to also use the STRETCH flag, which will bring the switching function smoothly to zero by stretching and shifting it. To be more clear, using

KEYWORD={RATIONAL R_0=1 D_MAX=3 STRETCH}

the resulting switching function will be \( s(r) = \frac{s'(r)-s'(d_{max})}{s'(0)-s'(d_{max})} \) where \( s'(r)=\frac{1-r^6}{1-r^{12}} \) Since PLUMED 2.2 this will become the default.