A conceptual description of methods is given in
[Mockus et al., 1997].
5 Turbo C Version (TCGM)
Descriptions of real life examples of global
in [Mockus et al., 1997] and in the next
part of this book.
The Turbo C version of the Global Minimizer TCGM is
to solve global optimization problems similar to those of the
Fortran version GMF. The optimization problem is defined
in terms of variables describing the parameters that we
can change, an objective function of those variables and some constraints restricting the
possible change of variables. Formally, that is a nonlinear programming problem
is a vector of variables. f(x) is an objective function.
defines rectangular constraints.
defines inequality constraints.
defines equality constraints. The objective
function is deterministic or stochastic (for some
constraints are defined for all the methods. The linear and
non-linear constraints are defined just for two local methods:
the Simplex by Nelder and Mead [Himmelblau, 1972], and
the non-linear programming by Schittkowski
- Turbo C version 2.0 or above.
- An experience of writing simple C functions.
- Copy the file from a web-site (see Section
4). Extract the GM files from the archive
Now the GLOBAL MINIMUM is ready to minimize the
problem that is defined in the file FI.C. Descriptions of
objective functions and constraints have to be in the same
file. Running GM.BAT, the file FI.C is displayed on the
screen by Turbo C editor. Rectangular constraints are defined
using the screen. Two algorithms, Nlp and Flexi, are exceptions.
Here the constraints are defined by C function constr in the file
FI.C. The four basic steps of initialization are
- Run the batch file GM.BAT using the command
GM, and enter the Turbo C editor.
- Define the
objective function as some C function with the name .
This function has two parameters:
- double array of values of each variable,
- the number of variables.
- Define the general linear or non-linear
constraints as a C function named constr. It has four
- double array of values of variables,
- double array of values of
- number of constraints.
- Compile file FI.C using directive Alt+C and correct possible errors.
- Link file FI.C to GLOBAL MINIMUM
system using directive Alt+L.
- Exit Turbo C using
The system will ask the following questions.
- run GM.BAT,
- edit file FI.C,
- compile FI.C,
- link file FI.C to system GLOBAL
Now one see the GLOBAL MINIMUM copyright notice.
GLOBAL MINIMUM is implemented as menu, dialog box and
windows system. Each object can be either active or
passive. There can be only one currently active object. A
user can work only with active objects. There is a rectangular caption at the top of each object (menu, dialog box, or window).
If this caption is bright, the object is active.
- Question: Number of variables.
Enter the number of variables of the problem.
- Question: Number of constraints.
Action: Enter the
number of linear and non-linear constraints of the problem
(not counting the number of rectangular constraints that are
- Main Menu
- press any key and enter the MAIN MENU,
- select the type of optimization or exit the menu system
- Global Optimization Menu
- select the GLOBAL item from the main menu,
- select any of six available global optimization
methods: LPMIN, MIG1, BAYES1, EXTR, UNT, GLOPT.
- Local Optimization Menu
- select LOCAL item from the main menu,
- select any of three available local optimization methods:
NLP, FLEXI, or LBAYES. The initial point for local
optimization is the result of previous global optimization, by default.
- Parameter Box
- display of the PARAMETER DIALOG BOX follows the
selection of method,
- enter corresponding
parameters of methods and press RETURN. Recommendations
how to choose parameters are given in the description of
methods [Mockus et al., 1997].
- Confirmation Menu
- CONFIRMATION MENU appears following the selection of
- RUN means run the method,
- EXIT means return to LOCAL or GLOBAL OPTIMIZATION MENU.
- Operation Menu
- OPERATION MENU appears following the selection
of RUN item,
- RUN means run the method,
in case if it was stopped by selecting STOP item,
- STOP means temporary stopping of the method and activating
the OUTPUT DIALOG BOX,
- press ENTER to return to the
OPERATION MENU and to make the OUTPUT DIALOG BOX inactive,
- EXIT means exit the method and return to GLOBAL
or LOCAL in the OPTIMIZATION MENU,
means return to GLOBAL or LOCAL in the OPTIMIZATION MENU,
after the method finishes optimization,
means turn RECORD WINDOW on/off,
means turn PROJECTION WINDOW on/off.
- Information Display
- OUTPUT DIALOG BOX shows the results of each
iteration (usually best point and goal function value at
this point) when the method runs (see Figure
Table of TCGM results.
- RECORD WINDOW shows how the best function value
depends on the iteration number (see Figure
Graph of TCGM results.
- RECORD WINDOW is on when the method is started,
- if the graph on RECORD WINDOW is horizontal for
a long time it can suggest that the minimum is reached or
that the method exhausted itself for this problem and it
is better to try another method,
- if one
selects RECORD item in OPERATION MENU while running the
method then the RECORD WINDOW becomes invisible, if it was
visible, and vice versa,
WINDOW shows the projection of the observed (calculated)
objective function values, the numbers of projection
planes correspond to the numbers of variables,
- if one selects a PROJECTION item in OPERATION MENU while
running the method, then one will see projection menu consisting
of two items: ON and OFF, meaning on/off the PROJECTION
- if one selects ON then the projection
dialog box appears and we can enter numbers defining
the projection planes,
- select the number, press ENTER
and one see how the observed values of the goal
function depend on the corresponding values of the
selected variable, the values of all other variables will
not be seen.
- RESULT DIALOG BOX shows the results of
calculations after the method finishes optimization.
- On Screen
- screen is divided into three areas: bottom,
middle and top, the functionality of these areas is
- bottom area is for general
information, such as description of variables, displaying
error messages, displaying the state of an active object,
- middle area is only for displaying and editing
- the top is a working area; menus,
dialog boxes and windows are displayed here.
- On Menu
- if some menu item is invisible, one opens it
using corresponding cursor keys: UP, DOWN, LEFT, RIGHT,
- the contents of the menu will scroll until the last
available item will be reached.
- Dialog Box
- on the DIALOG BOX one can see such variables as
the parameters of method, coordinates of the best and
current point, best and current values of goal function
and so on, to view a variable one selects the
- if the variable is a scalar,
one see the corresponding value, next to the
variable's name, the description of this variable is
displayed at the bottom area of a screen, the exact value
of the variable is displayed at the middle area,
- if the variable is a vector then, after
selecting the variables name, one can select the
corresponding component of the vector using keys LEFT and
RIGHT, the value of the selected component will be
in the middle area, the number of component will be in the bottom area, along with the description of
- to see invisible components of the
vector, use the keys LEFT and RIGHT, the vector scrolls, if there
are invisible components,
- press SPACE, to edit a
variable, press ENTER, to exit the editor.
- Press the F3 functional key and the red border
will appear, move the border with keys UP, DOWN, RIGHT,
LEFT and press ENTER to stop.
- The previous
image of the object will be deleted and the object will be
placed inside the new border.
No changes happens, if borders are greater than maximal size of the
object, or less than its minimal size.
- Press the F4 functional key, move the object
and press ENTER. The red border appears.
- Size the
border using the keys UP, DOWN, RIGHT, LEFT and press
ENTER to stop.
- The previous image of the object
is deleted and the object is placed into new