25.11.2015 Views

The MOSEK optimization toolbox for MATLAB manual Version 7.0 (Revision 141)

MATLAB optimization toolbox manual - Documentation - Mosek

MATLAB optimization toolbox manual - Documentation - Mosek

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

26 CHAPTER 7. A GUIDED TOUR<br />

which <strong>for</strong> the example (7.3) implies that<br />

and that<br />

⎡<br />

Q = ⎣<br />

1<br />

minimize<br />

2 xT Qx + c T x<br />

subject to l c ≤ Ax, ≤ u c ,<br />

l x ≤ x ≤ u x ,<br />

2 0 − 1<br />

0 0.2 0<br />

− 1 0 2<br />

⎤<br />

⎡<br />

⎦ , c = ⎣<br />

⎡<br />

l c = 1, u c = ∞, l x = ⎣<br />

0<br />

0<br />

0<br />

⎤<br />

0<br />

− 1<br />

0<br />

⎤<br />

⎦ , A = [ 1 1 1 ] ,<br />

⎡<br />

⎦ and u x = ⎣<br />

∞<br />

∞<br />

∞<br />

⎤<br />

⎦<br />

(7.4)<br />

Please note the explicit 1 2<br />

in the objective function of (7.4) which implies that diagonal elements must<br />

be doubled in Q, i.e. Q 11 = 2, whereas the coefficient in (7.3) is 1 in front of x 2 1.<br />

7.5.1 Two important assumptions<br />

<strong>MOSEK</strong> assumes that the Q matrix is symmetric, i.e.<br />

Q = Q T<br />

and that Q is positive semidefinite.A matrix is positive semidefinite if the smallest eigenvalue of the<br />

matrix is nonnegative. An alternative statement of the positive semidefinite requirement is<br />

x T Qx ≥ 0, ∀x.<br />

If Q is not positive semidefinite, then <strong>MOSEK</strong> will not produce reliable results or work at all.<br />

One way of checking whether Q is positive semidefinite is to check whether all the eigenvalues of Q<br />

are nonnegative. <strong>The</strong> <strong>MATLAB</strong> command eig computes all eigenvalues of a matrix.<br />

7.5.2 Using mskqpopt<br />

<strong>The</strong> subsequent <strong>MATLAB</strong> statements solve the problem (7.3) using the mskqpopt<strong>MOSEK</strong> function<br />

1 % qo1.m<br />

2<br />

3 % Set up Q.<br />

4 q = [[2 0 -1];[0 0.2 0];[-1 0 2]];<br />

5<br />

6 % Set up the linear part of the problem.<br />

7 c = [0 -1 0]’;<br />

[ qo1.m ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!