Functions

When performing biased dynamics or analysing a trajectory you may wish to analyse/bias the value of some function of a set of collective variables rather than the values of the collective variables directly. You can do this with PLUMED by using any one of the following list of functions.

Notice that in many functions you should explicitly say to PLUMED whether the result is a periodic variable or not using the keyword PERIODIC. This is crucial to allow a variable to be properly based. To know if a function is periodic of not you should answer to the following question:

  • Can my function change with a discontinuity when I move my atoms in a continuous manner?

In case the answer is no, than you should use PERIODIC=NO. In case the answer is yes, then you should consider the following question:

  • Are the values of the function at the discontinuity always the same or do they change?

In case the answer is that they are the same, you should use PERIODIC=A,B where A is the smallest value and B is the largest value. In case the answer is that the values at the discontinuity are not always the same, then you cannot construct a variable that can be biased with PLUMED. Consider the following examples:

t: TORSION ATOMS=1,2,3,4
# When atoms are moved, t could jump suddenly from -pi to +pi

c: MATHEVAL ARG=t FUNC=x*x*x PERIODIC=-31.0062766802998,31.0062766802998
# When atoms are moved, c could jump suddenly from -pi**3 to +pi**3

# equivalently, we could have used:
# c: COMBINE ARG=t POWERS=3 PERIODIC=-31.0062766802998,31.0062766802998

# compute x/y/z components of the distance between atoms 1 and 10
d: DISTANCE ATOMS=1,10 COMPONENTS

# make a new variable equal to d.z but with the correct periodicity
dz: COMBINE ARG=d.z PERIODIC=-10,10
# here we assumed the system is in a orthorhombic box with z side = 20
COMBINE Calculate a polynomial combination of a set of other variables.
CUSTOM An alias to the MATHEVAL function.
ENSEMBLE Calculates the replica averaging of a collective variable over multiple replicas.
FUNCPATHMSD This function calculates path collective variables.
FUNCSUMHILLS This function is intended to be called by the command line tool sum_hillsand it is meant to integrate a HILLS file or an HILLS file interpreted asa histogram i a variety of ways. Therefore it is not expected that you use thisduring your dynamics (it will crash!)
LOCALENSEMBLE Calculates the average over multiple arguments.
MATHEVAL Calculate a combination of variables using a matheval expression.
PIECEWISE Compute a piecewise straight line through its arguments that passes througha set of ordered control points.
SORT This function can be used to sort colvars according to their magnitudes.
STATS Calculates statistical properties of a set of collective variables with respect to a set of reference values.In particular it calculates and store as components the sum of the squared deviations, the correlation, theslope and the intercept of a linear fit.

In addition to the keywords above, by enabling optional modules you can access to the following keywords:

SELECT (from PLUMED-ISDB module) Selects an argument based on the value of a SELECTOR.