Module |
refdist |
Description |
Usage |
Calculate the differences between two scalars or vectors |
  |
output value |
type |
a function that measures the difference |
scalar/vector |
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/vector/matrix |
the values input to this function |
Further details and examples
Calculate the differences between two scalars or vectors
This action can be used to calculate the difference between two values. For example, if we want to calculate the difference
between the distances between atoms 1 and 2 and 3 and 4 we can use an input like the one shown below:
Click on the labels of the actions for more information on what each action computes
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | scalar | the DISTANCE between this pair of atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
d2The DISTANCE action with label d2 calculates the following quantities: Quantity | Type | Description |
d2 | scalar | the DISTANCE between this pair of atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4
diffThe DIFFERENCE action with label diff calculates the following quantities: Quantity | Type | Description |
diff | scalar | a function that measures the difference |
: DIFFERENCECalculate the differences between two scalars or vectors More details ARGthe values input to this function=d1,d2
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diff FILEthe name of the file on which to output these quantities=colvar
At first sight this action appears pointless as you can achieve the same result with the following input:
Click on the labels of the actions for more information on what each action computes
d1The DISTANCE action with label d1 calculates the following quantities: Quantity | Type | Description |
d1 | scalar | the DISTANCE between this pair of atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
d2The DISTANCE action with label d2 calculates the following quantities: Quantity | Type | Description |
d2 | scalar | the DISTANCE between this pair of atoms |
: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4
diffThe CUSTOM action with label diff calculates the following quantities: Quantity | Type | Description |
diff | scalar | an arbitrary function |
: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=d1,d2 FUNCthe function you wish to evaluate=x-y 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=diff FILEthe name of the file on which to output these quantities=colvar
However, this second example will not give an equivalent result to the following input:
Click on the labels of the actions for more information on what each action computes
t1The TORSION action with label t1 calculates the following quantities: Quantity | Type | Description |
t1 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
t2The TORSION action with label t2 calculates the following quantities: Quantity | Type | Description |
t2 | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=5,6,7,8
diffThe DIFFERENCE action with label diff calculates the following quantities: Quantity | Type | Description |
diff | scalar | a function that measures the difference |
: DIFFERENCECalculate the differences between two scalars or vectors More details ARGthe values input to this function=t1,t2
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diff FILEthe name of the file on which to output these quantities=colvar
as the CUSTOM command cannot caclulate differences between periodic input variables. In this case you have to
use DIFFERENCE to ensure that the periodic boundary conditions are applied when the final difference is calculated.
Difference from reference value/s
The DIFFERENCE command is frequently used to determine the difference between the instantaneous value of a quantity and
a reference value as illustrated in the example below:
Click on the labels of the actions for more information on what each action computes
ref_psiThe CONSTANT action with label ref_psi calculates the following quantities: Quantity | Type | Description |
ref_psi | scalar | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=2.25029540
ref_psi: CONSTANTCreate a constant value that can be passed to actions This action uses the defaults shown here. More details VALUESthe numbers that are in your constant value=2.25029540 NROWS the number of rows in your input matrix=0 NCOLS the number of columns in your matrix=0
tThe TORSION action with label t calculates the following quantities: Quantity | Type | Description |
t | scalar | the TORSION involving these atoms |
: TORSIONCalculate one or multiple torsional angles. More details ATOMSthe four atoms involved in the torsional angle=1,2,3,4
diffThe DIFFERENCE action with label diff calculates the following quantities: Quantity | Type | Description |
diff | scalar | a function that measures the difference |
: DIFFERENCECalculate the differences between two scalars or vectors More details ARGthe values input to this function=t,ref_psi
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diff FILEthe name of the file on which to output these quantities=colvar
You can also use this action to calculate the difference between the instaneous values of a vector of quantities and a
reference vector as illustrated in the example below:
Click on the labels of the actions for more information on what each action computes
refThe CONSTANT action with label ref calculates the following quantities: Quantity | Type | Description |
ref | vector | the constant value that was read from the plumed input |
: CONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUESthe numbers that are in your constant value=1.387980,1.126120,1.269380,1.321120,1.212420
ref: CONSTANTCreate a constant value that can be passed to actions This action uses the defaults shown here. More details VALUESthe numbers that are in your constant value=1.387980,1.126120,1.269380,1.321120,1.212420 NROWS the number of rows in your input matrix=0 NCOLS the number of columns in your matrix=0
dThe DISTANCES action with label d calculates the following quantities: Quantity | Type | Description |
d | vector | the DISTANCES between the each pair of atoms that were specified |
: DISTANCESCalculate the distances between multiple piars of atoms This action is a shortcut. More details ATOMS1the pairs of atoms that you would like to calculate the angles for=1,2 ATOMS2the pairs of atoms that you would like to calculate the angles for=3,4 ATOMS3the pairs of atoms that you would like to calculate the angles for=5,6 ATOMS4the pairs of atoms that you would like to calculate the angles for=7,8 ATOMS5the pairs of atoms that you would like to calculate the angles for=9,10
# d: DISTANCES ATOMS1=1,2 ATOMS2=3,4 ATOMS3=5,6 ATOMS4=7,8 ATOMS5=9,10
d_vatom1The CENTER_FAST action with label d_vatom1 calculates the following quantities: Quantity | Type | Description |
d_vatom1 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=1,2
d_vatom2The CENTER_FAST action with label d_vatom2 calculates the following quantities: Quantity | Type | Description |
d_vatom2 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=3,4
d_vatom3The CENTER_FAST action with label d_vatom3 calculates the following quantities: Quantity | Type | Description |
d_vatom3 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=5,6
d_vatom4The CENTER_FAST action with label d_vatom4 calculates the following quantities: Quantity | Type | Description |
d_vatom4 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=7,8
d_vatom5The CENTER_FAST action with label d_vatom5 calculates the following quantities: Quantity | Type | Description |
d_vatom5 | atoms | virtual atom calculated by CENTER_FAST action |
: CENTERCalculate the center for a group of atoms, with arbitrary weights. More details ATOMSthe group of atoms that you are calculating the Gyration Tensor for=9,10
d_grpThe GROUP action with label d_grp calculates the following quantities: Quantity | Type | Description |
d_grp | atoms | indices of atoms specified in GROUP |
: GROUPDefine a group of atoms so that a particular list of atoms can be referenced with a single label in definitions of CVs or virtual atoms. More details ATOMSthe numerical indexes for the set of atoms in the group=d_vatom1,d_vatom2,d_vatom3,d_vatom4,d_vatom5
dThe DISTANCE action with label d calculates the following quantities: Quantity | Type | Description |
d | vector | the DISTANCE for each set of specified atoms |
: 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 ATOMS5the pair of atom that we are calculating the distance between=9,10
# --- End of included input --- diffThe DIFFERENCE action with label diff calculates the following quantities: Quantity | Type | Description |
diff | vector | the vector obtained by doing an element-wise application of a function that measures the difference to the input vectors |
: DIFFERENCECalculate the differences between two scalars or vectors More details ARGthe values input to this function=d,ref
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=diff FILEthe name of the file on which to output these quantities=colvar
The output in this case is a five dimensional vector. Each element of this vector contains the difference between the
corresponding elements of the two input vectors.
Notice that you cannot use a mixture of scalars and vectors in the input for this action. Only two values can be input
to this action and these two input values must have the same rank and the same number of elements.
Syntax
The following table describes the keywords and options that can be used with this action
Keyword |
Type |
Default |
Description |
ARG |
input |
none |
the values input to this function |