Quickguide BMI Problem: Difference between revisions

From TomWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 4: Line 4:


<math>
<math>
Q^{i}_0 + \Sum{k=1}{n} Q^{i}_{k}x_{k} + \Sum{k=1}{n}\Sum{l=1}{n} x_{k}x_{l}K^{i}_{kl} \preccurlyeq 0 \\
Q^{i}_0 + \sum{k=1}{n} Q^{i}_{k}x_{k} + \sum{k=1}{n}\sum{l=1}{n} x_{k}x_{l}K^{i}_{kl} \preccurlyeq 0 \\
</math>
</math>


Line 14: Line 14:
Open the file for viewing, and execute bmiQG in Matlab.
Open the file for viewing, and execute bmiQG in Matlab.


<syntaxhighlight lang="matlab">
<source lang="matlab">
  % bmiQG is a small example problem for defining and solving
  % bmiQG is a small example problem for defining and solving
  % semi definite programming problems with bilinear matrix  
  % semi definite programming problems with bilinear matrix  
Line 59: Line 59:
   
   
  Result = tomRun('penbmi', Prob, 1);
  Result = tomRun('penbmi', Prob, 1);
</syntaxhighlight>
</source>

Revision as of 07:53, 17 January 2012

Notice.png

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

The linear semi-definite programming problem with bilinear matrix inequalities (bmi) is defined similarly to SDP but with the matrix inequality


Failed to parse (syntax error): {\displaystyle Q^{i}_0 + \sum{k=1}{n} Q^{i}_{k}x_{k} + \sum{k=1}{n}\sum{l=1}{n} x_{k}x_{l}K^{i}_{kl} \preccurlyeq 0 \\ }


The following file defines and solves a problem in TOMLAB.

File: tomlab/quickguide/bmiQG.m

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

 % bmiQG is a small example problem for defining and solving
 % semi definite programming problems with bilinear matrix 
 % inequalities using the TOMLAB format.
 
 Name='bmi.ps example 3';
 A   = [];
 b_U = [];
 b_L = [];
 
 c   = [ 0 0 1 ];  % cost vector 
 
 % One matrix constraint, set linear part first
 SDP = [];
 
 % The constant matrix is stored as 
 % SDP(i).Q{j} when SDP(i).Qidx(j) ==0
 SDP(1).Q{1}  = [-10 -0.5 -2 ;-0.5 4.5 0 ;-2 0 0 ];
 
 SDP(1).Q{2} = [ 9 0.5 0       ;  0.5  0  -3 ;  0  -3 -1 ];
 SDP(1).Q{3} = [-1.8 -0.1 -0.4 ; -0.1 1.2 -1 ; -0.4 -1 0 ];
 
 % Sparse is fine, too. Eventually, all the matrices are
 % converted to sparse format. 
 SDP(1).Q{4} = -speye(3); 
 
 SDP(1).Qidx = [0; 1; 2; 3];
 
 % Now bilinear part
 
 % K_12 of constraint 1 (of 1) is nonzero, so set in SDP(i).K{1}.
 SDP(1).K{1} = [0 0 2 ; 0 -5.5 3 ; 2 3 0 ];
 SDP(1).Kidx = [1 2];   
 n   = length(c);
 
 x_L = [-5 ; -3 ; -Inf];
 x_U = [ 2 ;  7 ;  Inf];
 x_0 = [ 0 ;  0 ;  0  ];
 
 f_Low = [];
 
 Prob = bmiAssign([], c, SDP, A, b_L, b_U, x_L, x_U, x_0,...
                  Name, f_Low);
 
 Result = tomRun('penbmi', Prob, 1);