Skip to content

Action: FIND_GRID_MINIMUM

Module gridtools
Description Usage
Find the point with the lowest value of the function on the grid used in 0 tutorialsused in 0 eggs

Details and examples

Find the point with the lowest value of the function on the grid

This command takes a function on a grid as input and returns multiple scalars. One of the returned scalars (the one with component optval) is the value of the input function at its lowest point. The other scalars returned are the coordinates for which the function takes this particular value.

As the input grid has the values of the function evaluated over a grid of points we find this minimum value by finding the point on the grid where the function has its lowest value using interpolation and conjugate gradients. The coordinates of the grid point where the function's value is lowest will be used as an initial coordinate for the optimisation. We then interpolate the function to find the optimum. You can use use the CGTOL keyword to control the conjugate gradient algorithm that is used to find the location of the minimum in the interpolated function.

To print out the location on the grid where the function is minimised and the value of the function at that point you can use an input like the one shown below:

Click on the labels of the actions for more information on what each action computes
tested on2.11
x: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
hA1: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ARGthe quantities that are being used to construct the histogram=x GRID_MIN the lower bounds for the grid=0.0 GRID_MAX the upper bounds for the grid=3.0 GRID_BINthe number of bins for the grid=100 BANDWIDTHthe bandwidths for kernel density esimtation=0.1
ff: CONVERT_TO_FESConvert a histogram to a free energy surface. This action is a shortcut. More details ARGthe histogram that you would like to convert into a free energy surface=hA1 TEMPthe temperature at which you are operating=300
min: FIND_GRID_MINIMUMFind the point with the lowest value of the function on the grid This action has hidden defaults. More details ARGthe label for the function on the grid that you would like to find the optimum in=ff
PRINTPrint quantities to a file. More details ARGthe labels of the values that you would like to print to the file=min.x_opt,min.optval STRIDE the frequency with which the quantities of interest should be output=0

Notice that we set STRIDE=0 in the PRINT command here so the position of the minimum is only output once at the end of the simulation.

A more common usage of this action is illustrated in the following input, which demonstrates how you can use FIND_GRID_MINIMUM to shift a free energy surface so that the minimum in the output fes has a value of zero.

Click on the labels of the actions for more information on what each action computes
tested on2.11
x: DISTANCECalculate the distance/s between pairs of atoms. More details ATOMSthe pair of atom that we are calculating the distance between=1,2
hA1: HISTOGRAMAccumulate the average probability density along a few CVs from a trajectory. This action is a shortcut and it has hidden defaults. More details ARGthe quantities that are being used to construct the histogram=x GRID_MIN the lower bounds for the grid=0.0 GRID_MAX the upper bounds for the grid=3.0 GRID_BINthe number of bins for the grid=100 BANDWIDTHthe bandwidths for kernel density esimtation=0.1
ff: CONVERT_TO_FESConvert a histogram to a free energy surface. This action is a shortcut. More details ARGthe histogram that you would like to convert into a free energy surface=hA1 TEMPthe temperature at which you are operating=300
min: FIND_GRID_MINIMUMFind the point with the lowest value of the function on the grid More details ARGthe label for the function on the grid that you would like to find the optimum in=ff NOINTERPOL do not interpolate the function when finding the optimum
sff: CUSTOMCalculate a combination of variables using a custom expression. More details ARGthe values input to this function=ff,min.optval 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
DUMPGRIDOutput the function on the grid to a file with the PLUMED grid format. More details ARGthe label for the grid that you would like to output=sff FILE the file on which to write the grid=fes.dat

Notice that the NOINTERPOL flag has been used here so the interpolation and conjugate gradient algorithm is not used. The output is simply the grid point at which the function takes its lowest value.

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 grid the label for the function on the grid that you would like to find the optimum in

Output components

This action calculates the values in the following table. These values can be referenced elsewhere in the input by using this Action's label followed by a dot and the name of the value required from the list below.

Name Type Description
optval scalar the value of the function at the optimum
_opt scalar the values of the arguments of the function at the optimum can be referenced elsewhere in the input file by using the names of the arguments followed by the string _opt

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 label for the function on the grid that you would like to find the optimum in
CGTOL compulsory 1E-4 the tolerance for the conjugate gradient optimization
NOINTERPOL optional false do not interpolate the function when finding the optimum