MATHEVAL
This is part of the function module

An alias to the CUSTOM function that can also be used to calaculate combinations of variables using a custom expression.

Documentation for this action is identical to that for CUSTOM

This alias is kept in order to maintain compatibility with previous PLUMED versions. However, notice that as of PLUMED 2.5 the libmatheval library is not linked anymore, and the MATHEVAL function is implemented using the Lepton library.

Examples

Just replace CUSTOM with MATHEVAL.

Click on the labels of the actions for more information on what each action computes
tested on v2.9
d: DISTANCE 
ATOMS
the pair of atom that we are calculating the distance between.
=10,15 m: MATHEVAL
ARG
the input for this action is the scalar output from one or more other actions.
=d
FUNC
compulsory keyword the function you wish to evaluate
=0.5*step(0.5-x)+x*step(x-0.5)
PERIODIC
compulsory keyword if the output of your function is periodic then you should specify the periodicity of the function.
=NO # check the function you are applying: PRINT
ARG
the input for this action is the scalar output from one or more other actions.
=d,m
FILE
the name of the file on which to output these quantities
=checkme RESTRAINT
ARG
the input for this action is the scalar output from one or more other actions.
=d
AT
compulsory keyword the position of the restraint
=0.5
KAPPA
compulsory keyword ( default=0.0 ) specifies that the restraint is harmonic and what the values of the force constants on each of the variables are
=10.0

(see also DISTANCE, PRINT, and RESTRAINT)

Glossary of keywords and components
Compulsory keywords
PERIODIC if the output of your function is periodic then you should specify the periodicity of the function. If the output is not periodic you must state this using PERIODIC=NO
FUNC the function you wish to evaluate
Options
NUMERICAL_DERIVATIVES

( default=off ) calculate the derivatives for these quantities numerically

ARG the input for this action is the scalar output from one or more other actions. The particular scalars that you will use are referenced using the label of the action. If the label appears on its own then it is assumed that the Action calculates a single scalar value. The value of this scalar is thus used as the input to this new action. If * or *.* appears the scalars calculated by all the proceeding actions in the input file are taken. Some actions have multi-component outputs and each component of the output has a specific label. For example a DISTANCE action labelled dist may have three components x, y and z. To take just the x component you should use dist.x, if you wish to take all three components then use dist.*.More information on the referencing of Actions can be found in the section of the manual on the PLUMED Getting Started. Scalar values can also be referenced using POSIX regular expressions as detailed in the section on Regular Expressions. To use this feature you you must compile PLUMED with the appropriate flag.. You can use multiple instances of this keyword i.e. ARG1, ARG2, ARG3...
VAR the names to give each of the arguments in the function. If you have up to three arguments in your function you can use x, y and z to refer to them. Otherwise you must use this flag to give your variables names.