Quickguide MINIMAX Problem: Difference between revisions
From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} The '''constrained minimax''' ('''mima''') problem is defined as <br clear="all" /> <math> \begin...") |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
<math> | <math> | ||
\begin{array}{cccccc} \min\limits_x & | \begin{array}{cccccc} \min\limits_x & {\max r(x)} \\ \mbox{subject to} & x_L & \leq & x & \leq & x_U \\ & b_L & \leq & Ax & \leq & b_U \\ & c_L & \leq & c(x) & \leq & c_U \\\end{array} | ||
</math> | </math> | ||
where <math>x,x_L,x_U \in | where <math>x,x_L,x_U \in R^{n}</math>, <math>r(x) \in R^{N}</math>, <math>c(x),c_L,c_U | ||
\in | \in R^{m_1}</math>, <math>b_L,b_U \in R^{m_2}</math> and <math>A \in R^{m_2 | ||
\times n}</math>. | \times n}</math>. | ||
Line 27: | Line 27: | ||
Open the file for viewing, and execute minimaxQG in Matlab. | Open the file for viewing, and execute minimaxQG in Matlab. | ||
< | <source lang="matlab"> | ||
% minimaxQG is a small example problem for defining and solving | % minimaxQG is a small example problem for defining and solving | ||
% minimax programming problems using the TOMLAB format. | % minimax programming problems using the TOMLAB format. | ||
Line 89: | Line 89: | ||
Prob.PriLevOpt = 0; | Prob.PriLevOpt = 0; | ||
Result = tomRun('infSolve', Prob, PriLev); | Result = tomRun('infSolve', Prob, PriLev); | ||
</ | </source> |
Latest revision as of 18:07, 17 January 2012
This page is part of the Quickguide Manual. See Quickguide. |
The constrained minimax (mima) problem is defined as
where , , , and .
The following files define a problem in TOMLAB.
File: tomlab/quickguide/mimaQG_r.m, mimaQG_J.m
r: Residual vector J: Jacobian matrix
The following file illustrates how to solve a minimax problem in TOMLAB. Also view the m-files specified above for more information.
File: tomlab/quickguide/minimaxQG.m
Open the file for viewing, and execute minimaxQG in Matlab.
% minimaxQG is a small example problem for defining and solving
% minimax programming problems using the TOMLAB format.
Name = 'Madsen-Tinglett 2';
x_0 = [1;1]; % Initial value
x_L = [-10;-10]; % Lower bounds on x
x_U = [10;10]; % Upper bounds on x
% Solve the problem min max |r_i(x)|, where i = 1,2,3
% Solve the problem by eliminating abs, doubling the residuals, reverse sign
% i.e. min max [r_1; r_2; r_3; -r_1; -r_2; -r_3];
y = [-1.5; -2.25; -2.625]; % The data values
y = [y ; -y]; % Eliminate abs, double the residuals, reverse sign
t = []; % No time vector used
%
% Add the linear constraint -x(1) + x(2) + 2 >= 0
% Write the constraint as x(1) - x(2) <= 2
% The A matrix could be specified dense or sparse
% A = sparse([1 -1]);
A = [1 -1];
b_L = -inf;
b_U = 2;
% Generate the problem structure using the Tomlab Quick format
%
% The part in the residuals dependent on x are defined in mima_r.m
% The Jacobian is defined in mima_J.m
Prob = clsAssign('mimaQG_r', 'mimaQG_J', [], x_L, x_U, Name, x_0, y, t, ...
[],[],[],[],A,b_L,b_U);
% Set the optimal values into the structure (for nice result presenting)
Prob.x_opt=[2.3660254038, 0.3660254038];
% Optimal residuals:
r_opt = [0; 0.2009618943;0.375];
% Compute optimal function value:
Prob.f_opt=max(abs(r_opt));
% Use the standard method in infSolve
Prob.InfType = 1;
% Get the default solver
% Solver = GetSolver('con',1,0);
Prob.SolverInf = 'conSolve';
% One may set other solvers:
%Prob.SolverInf = 'snopt';
%Prob.SolverInf = 'npsol';
%Prob.SolverInf = 'minos';
%Prob.SolverInf = 'conSolve';
% Set print level 2 to get output from PrintResult at the end
PriLev = 2;
Prob.PriLevOpt = 0;
Result = tomRun('infSolve', Prob, PriLev);