# TOMLAB  
# REGISTER (TOMLAB)
# LOGIN  
# myTOMLAB
TOMLAB LOGO

« Previous « Start » Next »

4  A Simple Example

At least two parts are needed when solving a problem with GENO, a main file and a file defining the objective function.

The following text can be entered into any Matlab m-file (save as genotest_f):

 function f = genotest_f(x, Prob)

 A = [4 4 4 4;1 1 1 1;8 8 8 8;6 6 6 6;3 7 3 7];
 c = [.1 .2 .2 .4 .4]';
 f=0;
 for i = 1:5
    f = f - 1./( (x-A(i,:)' )'*( x-A(i,:)' ) + c(i) );
 end

This defines the objective function to minimize.

The main file will define all static information about the problem, such as bounds and linear constraints:

 Name = 'GENO TEST';
 x_L = [ 0  0  0  0]';  % Lower bounds for x.
 x_U = [10 10 10 10]';  % Upper bounds for x.

 Prob = glcAssign('glbQG_f', x_L, x_U, Name);

 Result = tomRun('GENO', Prob, 1);

In order to run this glbQG  may be opened and the solver name switched to GENO.

« Previous « Start » Next »