# TOMNET  
# REGISTER (TOMNET)
# LOGIN  
# myTOMNET
TOMLAB LOGO

« Previous « Start » Next »

2  Overall Design

The scope of TOMNET is large and broad, hence there is a need for a well-designed system. It is natural to use the power of the .NET environment to make the system flexible and easy to use and maintain.

2.1  Input and Output

TOMNET solves the problem in two steps. First the problem is defined and stored in a .NET object. Any applicable solver can then be called from an instance of Result  (a standardized result container).

2.2  Problem Types

TOMNET solves a number of different optimization problems. The currently defined types are listed in Table 1.



Table 1: The different types of optimization problems defined in TOMNET.

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 a problem class (exceptions applies).



Table 2: Problem classes in TOMNET.

Class probType(s) Reference
LinearProblem lp 7.1
QuadraticProblem qp 7.2
NonlinearProblem uc, glb 7.3
ConProblem uc, con, glb 7.4
ConLinProblem con 7.5
LinearLeastSquaresProblem lls 7.6
NonlinearLeastSquaresProblem ls, cls 7.7

There are a number of test problems included with TOMNET. The folder testprob contains a large set of test problems, primarily for benchmark testing and development. The problems are implemented in .NET  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 TOMNET Base Module.



Table 3: Defined test problem sets in TOMNET.

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.
uhsProb 1 Hock-Schittkowski unconstrained test problems.
 

The problem may be accessed by creating instance using the class constructors or methods.

2.3  Solution Process

The process of optimization in TOMNET 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 constructor to create a problem instance.

  • Create an appropriate solver instance.

  • Modify solver options as needed.

  • Call the method Solve of the TOMNET Solver class.
If solving one of the pre-defined problems:
  • Create a problem instance. Select the problem set and number.

  • Create a solver instance and modify its options if needed.

  • Use solve to call the solver.
Depending on the type of problem, the user needs to supply the routines that calculate the objective function, constraint functions for constrained problems, and also if possible, derivatives. To simplify the coding process, TOMNET provides predefined interfaces to for the objective functions of a nonlinear problem.

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).

If derivatives are not given and the selected solver requires this information, numerical differentiation can be turned on.

2.3.1  Examples in TOMNET

This section is to illustrate how to use some routines in TOMNET. For example one can try to solve one of the chsProb examples with SNOPT. The following code snippet, available in TOMNET/usersguide/ChsProb8/ illustrates the solution process.

chsProb problem number 8 is solved. The problem is created with its constructor, subsequently solved by calling the solvers Solve-method. The outputs are the optimal solution xk, the optimal functional value fk and the time consumed to solve the problem, all stored in an instance of the Result class.
using System;
using TOMNET;

class ChsProb8
{
  static void Main(string[] args)
  {
    // 1 - Create Problem, Solver and Result.
    chsProbProblem prob = new chsProbProblem(8);
    SNOPT solver = new SNOPT();
    Result result;

    // 2 - Solve the problem.
    solver.Solve(prob, out result);

    // 3 - Write the optimum, objective value
    //     and time on the console.
    Console.Write("x_k  =");
    foreach (double d in result.x_k)
      Console.Write(" {0}", d);
    Console.WriteLine();

    Console.WriteLine("f_k  = {0}", result.f_k);
    Console.WriteLine("time = {0}", result.REALtime);
  }
}
It is also easy to solve a quadratic programming problem using for example SQOPT. The problem is created and solved in the same manner. Since this example uses the built-in class QuadraticProblem the syntax is a little different. The example as a whole is available in TOMNET/usersguide/QpProb15/
using System;
using TOMNET;

class QPProb15
{
  static void Main(string[] args)
  {
    // 1 - Create Problem, Solver and Result.
    QuadraticProblem prob = qpProb.getQpProb(15);
    SQOPT solver = new SQOPT();
    Result result;

    // 2 - Solve the problem.
    solver.Solve(prob, out result);

    // 3 - Write the objective value
    //     and time on the console.
    Console.WriteLine("f_k  = {0}", result.f_k);
    Console.WriteLine("time = {0}", result.REALtime);
  }
}
The qpProb test problem number 15 is created and solved. The output printing included here is the optimal objective value and the time consumed. The ouput but may be expanded to include further information by accessing the Result object.

« Previous « Start » Next »