Shortcut: AVERAGE
| Module | generic |
|---|---|
| Description | Usage |
| Calculate the ensemble average of a collective variable | |
| output value | type |
| the value of the average | scalar/grid |
Details and examples
Calculate the ensemble average of a collective variable
The ensemble average for a non-periodic, collective variable, is given by the following expression:
Here the sum runs over a the trajectory and is used to denote the value of the collective variable at time . The final quantity evaluated is a weighted average as the weights, If the simulation is unbiassed then all the values in teh expression above are zero. If the simulation is biased then the weights are set in a way that ensures the effect any bias has on the region of phase space sampled by the system is negated.
As the following example input shows you can use the AVERAGE shortcut to calculate the ensemble average of a CV using this formula:
d1: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d1a: AVERAGECalculate the ensemble average of a collective variable This action is a shortcut and it has hidden defaults. More details ARGthe quantity that is being averaged=d1 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=d1a FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=100
In this example no bias is acting on the system so the weights, in the formulas above can thus all be set equal to one. The shortcut illustrates how the averaging is achieved by using the ACCUMULATE action.
When the variable is periodic (e.g. TORSION) and has a value, , in the ensemble average is evaluated using:
You can see how ACCUMULATE and CUSTOM can be used to implement this formula by expanding the shortcuts in the following example input:
t1: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4 t1a: AVERAGECalculate the ensemble average of a collective variable This action is a shortcut and it has hidden defaults. More details ARGthe quantity that is being averaged=t1 CLEAR the frequency with whihc to clear the data that is being averaged=100 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=t1a FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=100
Notice that by using the CLEAR keyword we have specified that block averages
are to be calculated. Consequently, after 100 steps all the information acquired thus far in the simulation is
forgotten and the process of averaging is begun again. The quantities output in the colvar file are thus the
block averages taken over the first 100 frames of the trajectory, the block average over the second 100 frames
of trajectory and so on.
If a bias is acting upon the system then the values in the expression above are non-zero. You can calculate the $w(t') values by using REWEIGHT_BIAS or similar. To pass these weights to the average action you would then use an input something like the following:
t1: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4 RESTRAINTAdds harmonic and/or linear restraints on one or more variables. More details ARGthe values the harmonic restraint acts upon=t1 ATthe position of the restraint=pi KAPPA specifies that the restraint is harmonic and what the values of the force constants on each of the variables are=100. ww: REWEIGHT_BIASCalculate weights for ensemble averages that negate the effect the bias has on the region of phase space explored This action has hidden defaults. More details TEMPthe system temperature=300 t1a: AVERAGECalculate the ensemble average of a collective variable This action is a shortcut and it has hidden defaults. More details ARGthe quantity that is being averaged=t1 LOGWEIGHTSthe logarithm of the quantity to use as the weights when calculating averages=ww CLEAR the frequency with whihc to clear the data that is being averaged=100 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=t1a FILEthe name of the file on which to output these quantities=colvar STRIDE the frequency with which the quantities of interest should be output=100
This AVERAGE action in this input is a shortcut once again so by expanding it you can obtain a better understanding of how the formulas above are applied in this case.
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 | scalar/grid | the quantity that is being averaged |
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 quantity that is being averaged |
| STRIDE | compulsory | 1 | the frequency with which to store data for averaging |
| CLEAR | compulsory | 0 | the frequency with whihc to clear the data that is being averaged |
| LOGWEIGHTS | optional | not used | the logarithm of the quantity to use as the weights when calculating averages |
deprecated keywords
The keywords in the following table can still be used with this action but have been deprecated
| Keyword | Description |
|---|---|
| NORMALIZATION | Including this keyword in the input to this action makes no difference to the calculation performed it was used in older versions of PLUMED and is provided here for back compatibility only |