Here the sum runs over a the trajectory and \(s(t')\) is used to denote the value of the collective variable at time \(t'\). The final quantity evaluated is a weighted average as the weights, \(w(t')\), allow us to negate the effect any bias might have on the region of phase space sampled by the system. This is discussed in the section of the manual on Analysis.
When the variable is periodic (e.g. TORSION) and has a value, \(s\), in \(a \le s \le b\) the ensemble average is evaluated using:
The following example calculates the ensemble average for the distance between atoms 1 and 2 and output this to a file called COLVAR. In this example it is assumed that no bias is acting on the system and that the weights, \(w(t')\) in the formulas above can thus all be set equal to one.
Click on the labels of the actions for more information on what each action computes
d1: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,2 The DISTANCE action with label d1 calculates a single scalar valued1a: AVERAGEARGcompulsory keyword
the quantity that is being averaged =d1The AVERAGE action with label d1a calculates a single scalar valuePRINTARGthe input for this action is the scalar output from one or more other actions. =d1aFILEthe name of the file on which to output these quantities =colvar STRIDEcompulsory keyword ( default=1 )
the frequency with which the quantities of interest should be output =100 The PRINT action with label
d1: DISTANCEATOMSthe pair of atom that we are calculating the distance between. =1,2 The DISTANCE action with label d1 calculates a single scalar valued1a_weight: ONESSIZEcompulsory keyword
the number of ones that you would like to create =1 The ONES action with label d1a_weight calculates a single scalar valued1a_denom: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =d1a_weightSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =0 The ACCUMULATE action with label d1a_denom calculates a single scalar valued1a_prod: CUSTOMARGthe input to this function. =d1,d1a_weightFUNCcompulsory keyword
the function you wish to evaluate =x*y PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label d1a_prod calculates a single scalar valued1a_numer: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =d1a_prodSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =0 The ACCUMULATE action with label d1a_numer calculates a single scalar valued1a: CUSTOMARGthe input to this function. =d1a_numer,d1a_denomFUNCcompulsory keyword
the function you wish to evaluate =x/y PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label d1a calculates a single scalar valuePRINTARGthe input for this action is the scalar output from one or more other actions. =d1aFILEthe name of the file on which to output these quantities =colvar STRIDEcompulsory keyword ( default=1 )
the frequency with which the quantities of interest should be output =100 The PRINT action with label
The following example calculates the ensemble average for the torsional angle involving atoms 1, 2, 3 and 4. At variance with the previous example this quantity is periodic so the second formula in the above introduction is used to calculate the average. Furthermore, 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.
Click on the labels of the actions for more information on what each action computes
t1: TORSIONATOMSthe four atoms involved in the torsional angle =1,2,3,4 The TORSION action with label t1 calculates a single scalar valuet1a: AVERAGEARGcompulsory keyword
the quantity that is being averaged =t1CLEARcompulsory keyword ( default=0 )
the frequency with whihc to clear the data that is being averaged =100 The AVERAGE action with label t1a calculates a single scalar valuePRINTARGthe input for this action is the scalar output from one or more other actions. =t1aFILEthe name of the file on which to output these quantities =colvar STRIDEcompulsory keyword ( default=1 )
the frequency with which the quantities of interest should be output =100 The PRINT action with label
t1: TORSIONATOMSthe four atoms involved in the torsional angle =1,2,3,4 The TORSION action with label t1 calculates a single scalar valuet1a_weight: ONESSIZEcompulsory keyword
the number of ones that you would like to create =1 The ONES action with label t1a_weight calculates a single scalar valuet1a_denom: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =t1a_weightSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =100 The ACCUMULATE action with label t1a_denom calculates a single scalar valuet1a_sin: CUSTOMARGthe input to this function. =t1,t1a_weightFUNCcompulsory keyword
the function you wish to evaluate =y*sin((x--pi)/((pi--pi)/(pi+pi))) PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label t1a_sin calculates a single scalar valuet1a_cos: CUSTOMARGthe input to this function. =t1,t1a_weightFUNCcompulsory keyword
the function you wish to evaluate =y*cos((x--pi)/((pi--pi)/(pi+pi))) PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =NO The CUSTOM action with label t1a_cos calculates a single scalar valuet1a_sinsum: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =t1a_sinSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =100 The ACCUMULATE action with label t1a_sinsum calculates a single scalar valuet1a_cossum: ACCUMULATEARGthe input for this action is the scalar output from one or more other actions. =t1a_cosSTRIDEcompulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged =1 CLEARcompulsory keyword ( default=0 )
the frequency with which to clear all the accumulated data. =100 The ACCUMULATE action with label t1a_cossum calculates a single scalar valuet1a: CUSTOMARGthe input to this function. =t1a_sinsum,t1a_cossum,t1a_denomFUNCcompulsory keyword
the function you wish to evaluate =-pi+((pi--pi)/(pi+pi))*atan2(x/z,y/z) PERIODICcompulsory keyword
if the output of your function is periodic then you should specify the periodicity
of the function. =-pi,pi The CUSTOM action with label t1a calculates a single scalar valuePRINTARGthe input for this action is the scalar output from one or more other actions. =t1aFILEthe name of the file on which to output these quantities =colvar STRIDEcompulsory keyword ( default=1 )
the frequency with which the quantities of interest should be output =100 The PRINT action with label
This third example incorporates a bias. Notice that the effect the bias has on the ensemble average is removed by taking advantage of the REWEIGHT_BIAS method. The final ensemble averages output to the file are thus block ensemble averages for the unbiased canonical ensemble at a temperature of 300 K.
Click on the labels of the actions for more information on what each action computes
t1: TORSIONATOMSthe four atoms involved in the torsional angle =1,2,3,4 The TORSION action with label t1 calculates a single scalar valueRESTRAINTARGthe arguments on which the bias is acting. =t1ATcompulsory keyword
the position of the restraint =pi KAPPAcompulsory keyword ( default=0.0 )
specifies that the restraint is harmonic and what the values of the force constants
on each of the variables are =100. The RESTRAINT action with label ww: REWEIGHT_BIASTEMPthe system temperature. =300 The REWEIGHT_BIAS action with label ww calculates a single scalar valuet1a: AVERAGEARGcompulsory keyword
the quantity that is being averaged =t1LOGWEIGHTSthe logarithm of the quantity to use as the weights when calculating averages =wwCLEARcompulsory keyword ( default=0 )
the frequency with whihc to clear the data that is being averaged =100 The AVERAGE action with label t1a calculates a single scalar valuePRINTARGthe input for this action is the scalar output from one or more other actions. =t1aFILEthe name of the file on which to output these quantities =colvar STRIDEcompulsory keyword ( default=1 )
the frequency with which the quantities of interest should be output =100 The PRINT action with label
t1: TORSIONATOMSthe four atoms involved in the torsional angle =1,2,3,4 The TORSION action with label t1 calculates a single scalar valueww: REWEIGHT_BIASTEMPthe system temperature. =300 The REWEIGHT_BIAS action with label ww
Glossary of keywords and components
Description of components
Quantity
Description
.#!value
the value of the average
Compulsory keywords
ARG
the quantity that is being averaged
STRIDE
( default=1 ) the frequency with which to store data for averaging
CLEAR
( default=0 ) the frequency with whihc to clear the data that is being averaged
Options
LOGWEIGHTS
the logarithm of the quantity to use as the weights when calculating averages
NORMALIZATION
keyword for old version of the code that is there to maintain back compatibility only. Adding this keyword does nothing