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
the pair of atom that we are calculating the distance between.
=1,2 The DISTANCE action with label d1 calculates a single scalar valued1a_weight: ONES
SIZE
compulsory 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: ACCUMULATE
ARG
compulsory keyword
the label of the argument that is being added to on each timestep
=d1a_weight
STRIDE
compulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged
=1
CLEAR
compulsory 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: CUSTOM
ARG
compulsory keyword
the values input to this function
=d1,d1a_weight
FUNC
compulsory keyword
the function you wish to evaluate
=x*y
PERIODIC
compulsory 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: ACCUMULATE
ARG
compulsory keyword
the label of the argument that is being added to on each timestep
=d1a_prod
STRIDE
compulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged
=1
CLEAR
compulsory 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: CUSTOM
ARG
compulsory keyword
the values input to this function
=d1a_numer,d1a_denom
FUNC
compulsory keyword
the function you wish to evaluate
=x/y
PERIODIC
compulsory 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 valuePRINT
ARG
compulsory keyword
the labels of the values that you would like to print to the file
=d1a
FILE
the name of the file on which to output these quantities
=colvar
STRIDE
compulsory 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
=1,2,3,4 The TORSION action with label t1 calculates a single scalar valuet1a_weight: ONES
SIZE
compulsory 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: ACCUMULATE
ARG
compulsory keyword
the label of the argument that is being added to on each timestep
=t1a_weight
STRIDE
compulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged
=1
CLEAR
compulsory 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: CUSTOM
ARG
compulsory keyword
the values input to this function
=t1,t1a_weight
FUNC
compulsory keyword
the function you wish to evaluate
=y*sin((x--pi)/((pi--pi)/(pi+pi)))
PERIODIC
compulsory 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: CUSTOM
ARG
compulsory keyword
the values input to this function
=t1,t1a_weight
FUNC
compulsory keyword
the function you wish to evaluate
=y*cos((x--pi)/((pi--pi)/(pi+pi)))
PERIODIC
compulsory 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: ACCUMULATE
ARG
compulsory keyword
the label of the argument that is being added to on each timestep
=t1a_sin
STRIDE
compulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged
=1
CLEAR
compulsory 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: ACCUMULATE
ARG
compulsory keyword
the label of the argument that is being added to on each timestep
=t1a_cos
STRIDE
compulsory keyword ( default=1 )
the frequency with which the data should be collected and added to the quantity being
averaged
=1
CLEAR
compulsory 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: CUSTOM
ARG
compulsory keyword
the values input to this function
=t1a_sinsum,t1a_cossum,t1a_denom
FUNC
compulsory keyword
the function you wish to evaluate
=-pi+((pi--pi)/(pi+pi))*atan2(x/z,y/z)
PERIODIC
compulsory 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 valuePRINT
ARG
compulsory keyword
the labels of the values that you would like to print to the file
=t1a
FILE
the name of the file on which to output these quantities
=colvar
STRIDE
compulsory 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