Quickguide SIM Problem: Difference between revisions
(Created page with "{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} Simulation problems can be of any problem type, but in general they are global black-box problem int...") |
No edit summary |
||
Line 12: | Line 12: | ||
</math> | </math> | ||
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>, <math>A | ||
\in \ | \in \mathbb{R}^{m_1 \times n}</math>, <math>b_L,b_U \in \mathbb{R}^{m_1}</math> and | ||
<math>c_L,c(x),c_U \in \ | <math>c_L,c(x),c_U \in \mathbb{R}^{m_2}</math>. The variables <math>x \in I</math>, the | ||
index subset of <math>1,...,n</math>, are restricted to be integers. | index subset of <math>1,...,n</math>, are restricted to be integers. | ||
Line 34: | Line 34: | ||
Open the file for viewing, and execute simQG in Matlab. | Open the file for viewing, and execute simQG in Matlab. | ||
< | <source lang="matlab"> | ||
% simQG is a small example problem for defining and solving simulation | % simQG is a small example problem for defining and solving simulation | ||
% problems where the objective function and constraints are evaluated | % problems where the objective function and constraints are evaluated | ||
Line 56: | Line 56: | ||
% Prob.KNITRO.options.ALG = 3; | % Prob.KNITRO.options.ALG = 3; | ||
% Result2 = tomRun('knitro', Prob, 1); | % Result2 = tomRun('knitro', Prob, 1); | ||
</ | </source> |
Latest revision as of 18:19, 17 January 2012
This page is part of the Quickguide Manual. See Quickguide. |
Simulation problems can be of any problem type, but in general they are global black-box problem interfacing an external simulator. The setup may require that objective values and constraints are evaluated simultaneously. To accommodate this in TOMLAB a special assign routine has been developed, simAssign. The solver execution will be much more efficient if using this assign routine.
The simulation problem is identical to the mixed-integer nonlinear programming problem defined as:
where , , , and . The variables , the index subset of , are restricted to be integers.
Example problem:
The following files define a problem in TOMLAB.
File: tomlab/quickguide/simQG.m, simQG_fc.m, simQG_gdc.m
fc: Function value and nonlinear constraint vector gdc: Gradient vector and nonlinear constraint gradient matrix
The following file illustrates how to solve this simulation (SIM) problem in TOMLAB. Also view the m-files specified above for more information.
File: tomlab/quickguide/simQG.m
Open the file for viewing, and execute simQG in Matlab.
% simQG is a small example problem for defining and solving simulation
% problems where the objective function and constraints are evaluated
% during the same function call.
Name = 'HS 47';
b_L = [];
b_U = [];
A = [];
c_L = [0; 0; 0];
c_U = [0; 0; 0];
x_0 = [2; sqrt(2); -1; 2-sqrt(2); .5];
x_L = [];
x_U = [];
Prob = simAssign('simQG_fc', 'simQG_gdc', [], [], x_L, x_U, ...
Name, x_0, [], A, b_L, b_U, [], c_L, c_U);
Result = tomRun('snopt', Prob, 1);
% Prob.KNITRO.options.HESSOPT = 6;
% Prob.KNITRO.options.ALG = 3;
% Result2 = tomRun('knitro', Prob, 1);