Quickguide L1LIN Problem: Difference between revisions

From TomWiki
Jump to navigationJump to search
(Created page with "{{Part Of Manual|title=the Quickguide Manual|link=Quickguide}} The linearly '''constrained L1LIN''' ('''L1LIN''') problem is defined as <math> \begin{array}{cccc...")
 
No edit summary
 
Line 4: Line 4:


<math>
<math>
\begin{array}{cccccc}    \min\limits_x & \multicolumn{5}{l}{|Cx - y)| + alpha*|Lx|} \\    \mbox{subject to} & x_L & \leq &  x  & \leq & x_U \\    {}                & b_L & \leq &  Ax  & \leq & b_U \\\end{array}
\begin{array}{cccccc}    \min\limits_x & {5}{l}{|Cx - y)| + alpha*|Lx|} \\    \mbox{subject to} & x_L & \leq &  x  & \leq & x_U \\    {}                & b_L & \leq &  Ax  & \leq & b_U \\\end{array}
</math>
</math>


where <math>x,x_L,x_U \in \Rdim{n}</math>, <math>b_L,b_U \in \Rdim{m_2}</math>, <math>A\in
where <math>x,x_L,x_U \in \mathbb{R}^{n}</math>, <math>b_L,b_U \in \mathbb{R}^{m_2}</math>, <math>A\in
\Rdim{m_1 \times n}</math>, <math>C \in \Rdim{m_2 \times n}</math>, <math>y \in
\mathbb{R}^{m_1 \times n}</math>, <math>C \in \mathbb{R}^{m_2 \times n}</math>, <math>y \in
\Rdim{m_2}</math>, <math>L \in \Rdim{n \times b}</math> and <math>alpha \in \Rdim{1}</math>.
\mathbb{R}^{m_2}</math>, <math>L \in \mathbb{R}^{n \times b}</math> and <math>\alpha \in \mathbb{R}^{1}</math>.


The L1Lin solution can be obtained by the use of any suitable linear <span class="roman">TOMLAB</span> solver.
The L1Lin solution can be obtained by the use of any suitable linear <span class="roman">TOMLAB</span> solver.
Line 19: Line 19:
Open the file for viewing, and execute L1LinQG in Matlab.
Open the file for viewing, and execute L1LinQG in Matlab.


<syntaxhighlight lang="matlab">
<source lang="matlab">
  % L1LinQG is a small example problem for defining and solving
  % L1LinQG is a small example problem for defining and solving
  % a linearly constrained linear L1 problem using the TOMLAB format.
  % a linearly constrained linear L1 problem using the TOMLAB format.
Line 52: Line 52:
  % Prob.SolverL1 = 'CPLEX';
  % Prob.SolverL1 = 'CPLEX';
  % Result = tomRun('L1LinSolve', Prob, 1);
  % Result = tomRun('L1LinSolve', Prob, 1);
</syntaxhighlight>
</source>

Latest revision as of 18:12, 17 January 2012

Notice.png

This page is part of the Quickguide Manual. See Quickguide.

The linearly constrained L1LIN (L1LIN) problem is defined as


where , , , , , and .

The L1Lin solution can be obtained by the use of any suitable linear TOMLAB solver.

The following file illustrates how to solve an L1Lin problem in TOMLAB.

File: tomlab/quickguide/L1LinQG.m

Open the file for viewing, and execute L1LinQG in Matlab.

 % L1LinQG is a small example problem for defining and solving
 % a linearly constrained linear L1 problem using the TOMLAB format.
 
 Name='L1LinSolve test example';      % Problem name, not required.
 n = 6;                              
 x_L = -10*ones(n,1);                 % Lower bounds on x
 x_U =  10*ones(n,1);                 % Upper bounds on x
 x_0 = (x_L + x_U) / 2;               % Starting point
 
 C = spdiags([1 2 3 4 5 6]', 0, n, n); % C matrix
 y = 1.5*ones(n,1);                    % Data vector
 
 % Matrix defining linear constraints
 A = [1 1 0 0 0 0];
 b_L = 1;                  % Lower bounds on the linear inequalities
 b_U = 1;                  % Upper bounds on the linear inequalities
 
 % Defining damping matrix
 Prob.LS.damp = 1;
 Prob.LS.L = spdiags(ones(6,1)*0.01, 0, 6, 6);
 
 % See 'help llsAssign' for more information.
 Prob = llsAssign(C, y, x_L, x_U, Name, x_0, ...
                             [], [], [], ...
                             A, b_L, b_U);
                         
 Prob.SolverL1 = 'lpSimplex';
 Result = tomRun('L1LinSolve', Prob, 1);
 % Prob.SolverL1 = 'MINOS';
 % Result = tomRun('L1LinSolve', Prob, 1);
 % Prob.SolverL1 = 'CPLEX';
 % Result = tomRun('L1LinSolve', Prob, 1);