Shortcut: LOWEST
Module | function |
---|---|
Description | Usage |
This function can be used to find the lowest colvar by magnitude in a set. | |
output value | type |
the highest of the input values | scalar |
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/vector/matrix | the values input to this function |
Further details and examples
This function can be used to find the lowest colvar by magnitude in a set.
This action allows you to find the lowest of the input arguments. As a first example of how it might be used consider the following input:
d1DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 l1 : LOWESTThis function can be used to find the lowest colvar by magnitude in a set. 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=l1 FILEthe name of the file on which to output these quantities=colvar:
The value, l1
, that is output to the file colvar
here will be equal to d1
if d1<d2
and will be equal to d2
if d2<d1
. In other words, if
all the arguments input to a LOWEST action are scalars then the output value will be a scalar that is equal to the smallest of the input arguments.
Notice that you can also use this command with more than two arguments as illustrated below:
d1DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2 d2 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=3,4 d3 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=5,6 d4 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=7,8 l1 : LOWESTThis function can be used to find the lowest colvar by magnitude in a set. More details ARGthe values input to this function=d1,d2,d3,d4 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=l1 FILEthe name of the file on which to output these quantities=colvar:
Using a single vector as input
Instead of inputting multiple scalars you can input a single vector to this action instead as is illustrated below:
dDISTANCECalculate 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 l1 : LOWESTThis function can be used to find the lowest colvar by magnitude in a set. More details ARGthe values input to this function=d PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=l1 FILEthe name of the file on which to output these quantities=colvar:
The output from this action is a single scalar once again. This single scalar is equal to the smallest element of the input vector.
Using multiple vectors in input
If you input multiple vectors with the same numbers of elements to this action, as shown below, the output will be a vector.
d1DISTANCECalculate 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 d2 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=5,6 ATOMS2the pair of atom that we are calculating the distance between=7,8 d3 : DISTANCECalculate the distance/s between pairs of atoms. More details ATOMS1the pair of atom that we are calculating the distance between=9,10 ATOMS2the pair of atom that we are calculating the distance between=11,12 l2 : LOWESTThis function can be used to find the lowest colvar by magnitude in a set. More details ARGthe values input to this function=d1,d2,d3 PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=l2 FILEthe name of the file on which to output these quantities=colvar:
The elements of the output vector here are determined by doing an elementwise comparison of the elements in the input vectors. In the above
input the first element of h2
is equal to the distance between atoms 1 and 2 if this distance is smaller than the distances between atoms 5 and 6 and the distance between atoms 9 and 10.
By the same token the second element of h2
is equal to the distance between atoms 3 and 4 if this is smaller than the distance between atoms 7 and 8 and the distance between atoms 11 and 12.
In other words, if the elements of the jth input vector are given by v(j)i then the elements of the output vector, hi are given by:
hi=minjv(j)i
Notice that you can also use a combination of scalars and vectors in the input to this action as shown below:
cCONSTANTCreate a constant value that can be passed to actions This action has hidden defaults. More details VALUEthe single number that you would like to store=0.5 : 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 h : LOWESTThis function can be used to find the lowest colvar by magnitude in a set. More details ARGthe values input to this function=d,c PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=h FILEthe name of the file on which to output these quantities=colvar
For the input above the LOWEST action outputs a vector with two elements. The elements of this vector are equal to the distances between the pairs
of atoms that are specified in the DISTANCE command as long as those distances are less than 0.5 nm. If either of the two input distances is more
han 0.5 nm then the corresponding value in the vector h
is set equal to 0.5 nm.
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 |