Action: MEAN
| Module | function |
|---|---|
| Description | Usage |
| Calculate the arithmetic mean of the elements in a vector | |
| output value | type |
| the MEAN of the elements in the input value | scalar |
Details and examples
Calculate the arithmetic mean of the elements in a vector
This action takes a single vector or a single matrix in input. The output is a scalar that contains the mean of all the elements in the input vector/matrix. This action is useful if you want do to calculations like the one illustrated in this example:
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8 m: MEANCalculate the arithmetic mean of the elements in a vector More details ARGthe vector/matrix/grid whose elements shuld be added together=d PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=m FILEthe name of the file on which to output these quantities=colvar
The output from the MEAN action here is the average over the four distances that are evaluated by the DISTANCE action. Notice that you can also do the calculation above using:
d: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=1,2 ATOMS2the pair of atom that we are calculating the distance between=3,4 ATOMS3the pair of atom that we are calculating the distance between=5,6 ATOMS4the pair of atom that we are calculating the distance between=7,8 s: SUMCalculate the sum of the arguments More details ARGthe vector/matrix/grid whose elements shuld be added together=d PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO m: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=s FUNCthe function you wish to evaluate=x/4 PERIODICif the output of your function is periodic then you should specify the periodicity of the function=NO PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=m FILEthe name of the file on which to output these quantities=colvar
Input
The arguments that serve as the input for this action are specified using one or more of the keywords in the following table.
| Keyword | Type | Description |
|---|---|---|
| ARG | vector/matrix/grid | the vector/matrix/grid whose elements shuld be added together |
Full list of keywords
The following table describes the keywords and options that can be used with this action
| Keyword | Type | Default | Description |
|---|---|---|---|
| ARG | input | none | the vector/matrix/grid whose elements shuld be added together |
| PERIODIC | compulsory | none | if the output of your function is periodic then you should specify the periodicity of the function |