Quickguide GLB Problem: Difference between revisions
From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} The '''unconstrained global optimization''' ('''glb''') problem is defined as <math> \begin{arra...") |
No edit summary |
||
Line 14: | Line 14: | ||
where <math>x, x_L, x_U \in \ | where <math>x, x_L, x_U \in \mathbb{R}^n</math>, <math>f(x) \in \mathbb{R}</math>. | ||
The following files define a problem in TOMLAB. | The following files define a problem in TOMLAB. | ||
Line 30: | Line 30: | ||
Open the file for viewing, and execute glbQG in Matlab. | Open the file for viewing, and execute glbQG in Matlab. | ||
< | <source lang="matlab"> | ||
% glbQG is a small example problem for defining and solving | % glbQG is a small example problem for defining and solving | ||
% unconstrained global programming problems using the TOMLAB format. | % unconstrained global programming problems using the TOMLAB format. | ||
Line 63: | Line 63: | ||
% Result = tomRun('lgo', Prob, 1); | % Result = tomRun('lgo', Prob, 1); | ||
% Result = tomRun('oqnlp', Prob, 1); | % Result = tomRun('oqnlp', Prob, 1); | ||
</ | </source> |
Latest revision as of 07:51, 17 January 2012
This page is part of the Quickguide Manual. See Quickguide. |
The unconstrained global optimization (glb) problem is defined as
where , .
The following files define a problem in TOMLAB.
File: tomlab/quickguide/glbQG_f.m
f: Function
The following file illustrates how to solve an unconstrained global optimization problem in TOMLAB. Also view the m-file specified above for more information.
File: tomlab/quickguide/glbQG.m
Open the file for viewing, and execute glbQG in Matlab.
% glbQG is a small example problem for defining and solving
% unconstrained global programming problems using the TOMLAB format.
Name = 'Shekel 5';
x_L = [ 0 0 0 0]'; % Lower bounds for x.
x_U = [10 10 10 10]'; % Upper bounds for x.
x_0 = [-3.0144 -2.4794 -3.1584 -3.1790]; % Most often not used.
x_opt = [];
f_opt = -10.1531996790582;
f_Low = -20; % Lower bound on function.
x_min = [ 0 0 0 0]; % For plotting
x_max = [10 10 10 10]; % For plotting
Prob = glcAssign('glbQG_f', x_L, x_U, Name, [], [], [], ...
[], [], [], x_0, ...
[], [], [], [], ...
f_Low, x_min, x_max, f_opt, x_opt);
Prob.optParam.MaxFunc = 1500;
Result1 = tomRun('glbFast', Prob, 1); % Global solver
Result2 = tomRun('conSolve', Prob, 2); % Local solver, starting from Prob.x_0
% Also possible to use a mixed-integer global solver
Result = tomRun('glcDirect', Prob, 1);
% Result = tomRun('glbDirect', Prob, 1);
% Result = tomRun('glcDirect', Prob, 1);
% Result = tomRun('glbSolve', Prob, 1);
% Result = tomRun('glcSolve', Prob, 1);
% Result = tomRun('glcFast', Prob, 1);
% Result = tomRun('lgo', Prob, 1);
% Result = tomRun('oqnlp', Prob, 1);