Shortcut: HIGHEST

Module function
Description Usage
This function can be used to find the highest colvar by magnitude in a set. used in 0 tutorialsused in 0 eggs
output value type
the lowest 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 highest colvar by magnitude in a set.

This action allows you to find the highest of the input arguments. As a first example of how it might be used consider the following input:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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
h1: HIGHESTThis function can be used to find the highest 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=h1 FILEthe name of the file on which to output these quantities=colvar

The value, h1, 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 HIGHEST action are scalars then the output value will be a scalar that is equal to the largest of the input arguments. Notice that you can also use this command with more than two arguments as illustrated below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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
h1: HIGHESTThis function can be used to find the highest 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=h1 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:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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
h1: HIGHESTThis function can be used to find the highest 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=h1 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 largest 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.

Click on the labels of the actions for more information on what each action computes
tested on2.11
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: HIGHESTThis function can be used to find the highest 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=h2 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 larger 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 larger 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=max

Notice that you can also use a combination of scalars and vectors in the input to this action as shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
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.05
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: HIGHESTThis function can be used to find the highest 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 HIGHEST 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 greater than 0.05 nm. If either of the two input distances is less than 0.05 nm then the corresponding value in the vector h is set equal to 0.05 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