« Previous « Start » Next »
2 Overall Design
The scope of TOMVIEW is large and broad, hence there is a need for a
well-designed system. It is natural to use the power of the LabVIEWenvironment, to make the system flexible and easy to use and
maintain.
Figure 1:
LabVIEW 7.1 or above is required for
TOMVIEW

2.1 Input and Output
Normally, when solving an optimization problem, a direct call to a
solver is made with a long list of parameters in the call. The
parameter list is solver-dependent and makes it difficult to make
additions and changes to the system.
TOMVIEW solves the problem in two steps. First the problem is defined
and stored in a LabVIEW object. The solver is then called with a
single string argument and the problem structure. This is handled by
the driver VI
tomRun which can call any available solver,
hiding the details of the call from the user. The solver output is
made available in a standardized result structure.
2.2 Problem Types
TOMVIEW solves a number of different optimization problems. The
currently defined types are listed in Table
1.
The
Prob variable
probType contains the current type of
optimization problem to be solved. An optimization solver is defined
to be of type
solvType, where
solvType is any of the
probType entries in Table
1. A certain
solvType might be able to solve a problem of several other
types. For example, a constrained nonlinear programming solver (for
example SNOPT, MINOS) can solve unconstrained problems, linear and
quadratic programs and constrained nonlinear least squares problems.
Table 1:
The different types of optimization problems defined in TOMVIEW.
|
| probType |
|
Type of optimization problem |
|
| uc |
1 |
Unconstrained optimization (incl. bound constraints). |
| qp |
2 |
Quadratic programming. |
| con |
3 |
Constrained nonlinear optimization. |
| ls |
4 |
Nonlinear least squares problems (incl. bound constraints). |
| lls |
5 |
Linear least squares problems. |
| cls |
6 |
Constrained nonlinear least squares problems. |
| mip |
7 |
Mixed-Integer programming. |
| lp |
8 |
Linear programming. |
| glb |
9 |
Box-bounded global optimization. |
| glc |
10 |
Global mixed-integer nonlinear programming. |
| miqp |
11 |
Constrained mixed-integer quadratic programming. |
| minlp |
12 |
Constrained mixed-integer nonlinear optimization. |
|
Each
probType corresponds to an assign routine (exceptions
applies).
There are a number of test problems included with TOMVIEW. The folder
testprob contains a large set of test problems, primarily for
benchmark testing and development. The problems are implemented in
LabVIEW and the user functions are coded in C. The folder
quickguide contains smaller problems on the standard format.
It is recommended to look at the quick guide problems when
implementing custom problems.
The following table defines the test problems included with the
TOMVIEW Base Module.
Table 2:
Defined test problem sets in TOMVIEW.
|
| probSet |
probType |
Description of test problem set |
|
| chsProb |
3 |
Hock-Schittkowski constrained test problems. |
| clsProb |
6 |
Constrained nonlinear least squares problems. |
| conProb |
3 |
Constrained test problems. |
| glbProb |
9 |
Box-bounded global optimization test problems. |
| glcProb |
10 |
Global MINLP test problems. |
| lgoProb |
9 |
Box-bounded global optimization test problems (LGO). |
| llsProb |
5 |
Linear least squares problems. |
| lpProb |
8 |
Linear programming problems. |
| mghProb |
4 |
More, Garbow, Hillstrom nonlinear least squares problems. |
| minlpProb |
12 |
Mixed-integer nonlinear programming problems. |
| mipProb |
7 |
Mixed-integer programming problems. |
| miqpProb |
11 |
Mixed-integer quadratic programming problems. |
| qpProb |
2 |
Quadratic programming test problems. |
| ucProb |
1 |
Unconstrained test problems. |
| chsProb |
1 |
Hock-Schittkowski unconstrained test problems. |
| |
|
The problem may be accessed in two different ways, either the
probInit.vi is used with a subsequent call to
tomRun, or
*Examples may be opened for each problem set respectively.
2.3 Solution Process
The process of optimization in TOMVIEW is quite straight forward, even
to the beginner. It is efficient and easy to use the interactive
system. In general, the following process may be followed:
- Identify the problem type to be solved.
- Select and use the appropriate assign routine to create a
problem instance.
- Modify solver settings as needed.
- Select an appropriate solver and call the driver routine tomRun.
If solving one of the pre-defined problems:
- Use probInit to create a problem instance. Select the
problem set and number.
- Modify solver settings if needed.
- Use tomRun to call the solver.
Depending on the type of problem, the user needs to supply the
low-level routines that calculate the objective function,
constraint functions for constrained problems, and also if possible,
derivatives. To simplify the coding process, TOMVIEW provides
gateway routines that ensure that all solvers obtain the correct
format.
For example, when working with a least squares problem, it is
natural to code the function that computes the vector of residual
functions
ri(
x1,
x2,…), since a dedicated least squares
solver probably operates on the residual while a general nonlinear
solver needs a scalar function, in this case
f(
x) = 1/2
rT(
x)
r(
x). Such issues are automatically handled by the gateway
functions included in the system.
If derivatives are not given and the selected solver requires this
information, the system will automatically ensure that it is
provided by numerical differentiation.
2.3.1 Examples in TOMVIEW
This section is to illustrate how to use some routines in TOMVIEW.
For example one can try to solve one of the chsProb examples with
SNOPT. The following figure illustrates the solution process in
LabVIEW.
Figure 2:
Block Diagram - assigning and solving a
chs test problem.
chsProb problem number 8 is solved. It is assigned with the probInit
block. It is subsequently solved in the tomRun node with the solver
SNOPT. The outputs are the optimal solution
xk, the optimal
functional value
fk and the time consumed to solve the problem.
It is trivial to solve a qpProb problem use SQOPT instead. The
problem is created and solved in the same manner.
Figure 3:
Block Diagram - assigning and solving a qp
test problem.
The qpProb test problem number 15 is created and the output
variables are the same as before. The output cluster may be expanded
to include further information.
2.4 Low Level Routines and Gateway Routines
Low level routines are the routines that compute:
-
The objective function value
- The gradient vector
- The Hessian matrix (second derivative matrix)
- The residual vector (for nonlinear least squares problems)
- The Jacobian matrix (for nonlinear least squares problems)
- The vector of constraint functions
- The matrix of constraint derivatives (the constraint Jacobian)
- The second part of the second derivative of the Lagrangian function.
The last three routines are only needed for constrained problems.
Observe that only the
KNITRO solver can make use of second
order information.
The names of these routines are defined in the structure fields
Prob.FUNCS.f,
Prob.FUNCS.g,
Prob.FUNCS.H etc. It
is a task for the
assign routine to set the names of the low
level VI's. This is done by using, for example, the routine
assign_con with the references as inputs.
Only the low level routines relevant for a certain type of
optimization problem need to be coded. Numerical differentiation is
automatically used for gradient, Jacobian and constraint gradient if
the corresponding user routine is non present or left out when
calling
assign_con. However, the solver always needs more
time to estimate the derivatives compared to if the user supplies
code for them. Also the numerical accuracy is lower for estimated
derivatives, so it is recommended that the user always tries to code
the derivatives, if it is possible.
TOMVIEW uses a variety of gateway routines to handle the special
solver needs.
To get a picture of how the low-level routines are used in the
system, consider Figure
4 and
5. Figure
4 illustrates the
chain of calls when computing the objective function value in
SNOPT for a nonlinear least squares problem defined in
mghProb_Examples,
mghProb_R and
mghProb_J.
Figure
5 illustrates the chain of calls when
computing the numerical approximation of the gradient (by use of the
VI
callback_fdng) in
SNOPT for an unconstrained
problem defined in
ucProb_Examples and
ucProb_F.
Figure 4: The chain of calls when computing the objective function
value in SNOPT for a nonlinear least squares problem defined
in mghProb_Examples, mghProb_R and
mghProb_J.
Figure 5: The chain of calls when computing the numerical
approximation of the gradient in SNOPT for an unconstrained
problem defined in ucProb_Examples and ucProb_F.
« Previous « Start » Next »