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 |
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:
d1: DISTANCECalculate 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:
d1: DISTANCECalculate 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:
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 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.
d1: 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 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 th input vector are given by then the elements of the output vector, are given by:
Notice that you can also use a combination of scalars and vectors in the input to this action as shown below:
c: CONSTANTCreate 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
than 0.5 nm then the corresponding value in the vector h is set equal to 0.5 nm.
The MASK keyword
You should only use the MASK keyword for this action if you are using multiple arguments and at least one vector in the input to this action. The following input illustrates how this keyword works:
m: 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,0 d1: 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 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 h2: 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 MASKthe label for a sparse vector/matrix that should be used to determine which elements of the vector/matrix should be computed=m
By using the MASK keyword here you ensure that only the first element of the output vector for h2 is calculated. This element of the output vector
is evaluated as the corresponding element of the vector that is passed in the input to the MASK keyword is one. By the same logic the second element
of the output vector is not computed because the corresponding element in the mask vector is 0.
The input above illustrates the key idea for the MASK keyword and is probably not very useful. To see an example where using a MASK for this type of action is useful you should look at the expanded shortcuts in the documentation for PARABETARMSD.
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 |
| MASK | vector/matrix | the label for a sparse vector/matrix that should be used to determine which elements of the vector/matrix should be computed |
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 values input to this function |
| MASK | input | none | the label for a sparse vector/matrix that should be used to determine which elements of the vector/matrix should be computed |