[37] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
---|
| 2 | <html> |
---|
| 3 | |
---|
| 4 | <head> |
---|
| 5 | <meta http-equiv="Content-Language" content="en-us"> |
---|
| 6 | <title>YALMIP Example : Solving BMIs locally</title> |
---|
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> |
---|
| 8 | <meta content="Microsoft FrontPage 6.0" name="GENERATOR"> |
---|
| 9 | <meta name="ProgId" content="FrontPage.Editor.Document"> |
---|
| 10 | <link href="yalmip.css" type="text/css" rel="stylesheet"> |
---|
| 11 | <base target="_self"> |
---|
| 12 | </head> |
---|
| 13 | |
---|
| 14 | <body leftMargin="0" topMargin="0"> |
---|
| 15 | |
---|
| 16 | <div align="left"> |
---|
| 17 | |
---|
| 18 | <table border="0" cellpadding="4" cellspacing="3" style="border-collapse: collapse" bordercolor="#000000" width="100%" align="left" height="100%"> |
---|
| 19 | <tr> |
---|
| 20 | <td width="100%" align="left" height="100%" valign="top"> |
---|
| 21 | <h2>Local solution of bilinear matrix inequalities (BMIs)</h2> |
---|
| 22 | <hr noShade SIZE="1"> |
---|
| 23 | <p> |
---|
| 24 | <img border="0" src="exclamationmark.jpg" align="left" width="16" height="16">This |
---|
| 25 | example requires the solver <a href="solvers.htm#penbmi">PENBMI</a></p> |
---|
| 26 | <p>BMI problems are solved locally just as easy as standard SDP |
---|
| 27 | problems, by using the solver <a href="solvers.htm#penbmi">PENBMI</a>. As an example, the <a href="gevp.htm">decay-rate estimation problem</a> that we |
---|
| 28 | earlier solved using a bisection, is solved with the following code.</p> |
---|
| 29 | <table cellPadding="10" width="100%"> |
---|
| 30 | <tr> |
---|
| 31 | <td class="xmpcode"> |
---|
| 32 | <pre>A = [-1 2;-3 -4]; |
---|
| 33 | t = sdpvar(1,1); |
---|
| 34 | P = sdpvar(2,2); |
---|
| 35 | F = set(P>eye(2))+set(A'*P+P*A < -2*t*P); |
---|
| 36 | solvesdp(F,-t);</pre> |
---|
| 37 | </td> |
---|
| 38 | </tr> |
---|
| 39 | </table> |
---|
| 40 | <p> <a href="solvers.htm#penbmi">PENBMI</a> seem to perform better if |
---|
| 41 | variables are constrained, so the following code is often recommended (see |
---|
| 42 | the <a href="advanced.htm">advanced programming examples</a>).</p> |
---|
| 43 | <table cellPadding="10" width="100%"> |
---|
| 44 | <tr> |
---|
| 45 | <td class="xmpcode"> |
---|
| 46 | <pre>A = [-1 2;-3 -4]; |
---|
| 47 | t = sdpvar(1,1); |
---|
| 48 | P = sdpvar(2,2); |
---|
| 49 | F = set(P>eye(2))+set(A'*P+P*A < -2*t*P); |
---|
| 50 | |
---|
| 51 | F = F + set(-100 < recover(depends(F)) < 100); |
---|
| 52 | |
---|
| 53 | solvesdp(F,-t);</pre> |
---|
| 54 | </td> |
---|
| 55 | </tr> |
---|
| 56 | </table> |
---|
| 57 | <p>As another example, the code below calculates an LQ optimal feedback. |
---|
| 58 | (of-course, this can be solved much more efficiently by first recasting it |
---|
| 59 | as a convex problem)</p> |
---|
| 60 | <table cellPadding="10" width="100%"> |
---|
| 61 | <tr> |
---|
| 62 | <td class="xmpcode"> |
---|
| 63 | <pre>A = [-1 2;-3 -4];B = [1;1]; |
---|
| 64 | P = sdpvar(2,2);K = sdpvar(1,2); |
---|
| 65 | F = set(P>0)+set((A+B*K)'*P+P*(A+B*K) < -eye(2)-K'*K); |
---|
| 66 | solvesdp(F,trace(P));</pre> |
---|
| 67 | </td> |
---|
| 68 | </tr> |
---|
| 69 | </table> |
---|
| 70 | <p>More interesting, we can solve the LQ problem with constraints on the |
---|
| 71 | feedback matrix.</p> |
---|
| 72 | <table cellPadding="10" width="100%"> |
---|
| 73 | <tr> |
---|
| 74 | <td class="xmpcode"> |
---|
| 75 | <pre>A = [-1 2;-3 -4];B = [1;1]; |
---|
| 76 | P = sdpvar(2,2);K = sdpvar(1,2); |
---|
| 77 | F = set(K<0.1)+set(K>-0.1)+set(P>0)+set((A+B*K)'*P+P*(A+B*K) < -eye(2)-K'*K); |
---|
| 78 | solvesdp(F,trace(P));</pre> |
---|
| 79 | </td> |
---|
| 80 | </tr> |
---|
| 81 | </table> |
---|
| 82 | <p>Reasonable initial guesses is often crucial in non-convex optimization. |
---|
| 83 | The easiest way to specify initial guesses in YALMIP is to use the field |
---|
| 84 | <code>usex0</code> in |
---|
| 85 | <a href="reference.htm#sdpsettings"> |
---|
| 86 | sdpsettings</a> and the command |
---|
| 87 | <a href="reference.htm#assign"> |
---|
| 88 | assign</a>. Consider the constrained LQ example above, and let us specify |
---|
| 89 | an initial guess using a standard LQ feedback. </p> |
---|
| 90 | <table cellPadding="10" width="100%"> |
---|
| 91 | <tr> |
---|
| 92 | <td class="xmpcode"> |
---|
| 93 | <pre>A = [-1 2;-3 -4];B = [1;1]; |
---|
| 94 | [K0,P0] = lqr(A,B,eye(2),1); |
---|
| 95 | P = sdpvar(2,2);assign(P,P0); |
---|
| 96 | K = sdpvar(1,2);assign(K,-K0); |
---|
| 97 | F = set(K<0.1)+set(K>-0.1)+set(P>0)+set((A+B*K)'*P+P*(A+B*K) < -eye(2)-K'*K); |
---|
| 98 | solvesdp(F,trace(P),sdpsettings('usex0',1));</pre> |
---|
| 99 | </td> |
---|
| 100 | </tr> |
---|
| 101 | </table> |
---|
| 102 | <p><img border="0" src="demoicon.gif" width="16" height="16"><a href="solvers.htm#penbmi">PENBMI</a> |
---|
| 103 | supports non-convex quadratic objective functions. Hence you can |
---|
| 104 | (locally) solve non-convex quadratically constrained quadratic |
---|
| 105 | programming using PENBMI. |
---|
| 106 | <!-- <p><img border="0" src="demoicon.gif" width="16" height="16">You can |
---|
| 107 | actually (try to...) solve the BMI above without PENBMI. The internal solver <code>'bmilin'</code> is one |
---|
| 108 | alternative. Note though that this solver is slow and unstable. It is |
---|
| 109 | based on a simple sequential linearization approach with a |
---|
| 110 | trust-region, and is merely implemented to show how a simple |
---|
| 111 | BMI-solver can be coded using a few lines of YALMIP code. For more |
---|
| 112 | information, check out Example 14 in |
---|
| 113 | <a href="reference.htm#yalmipdemo">yalmipdemo</a>.--> |
---|
| 114 | <p><img border="0" src="demoicon.gif" width="16" height="16">YALMIP |
---|
| 115 | will automatically convert higher order polynomial programs to |
---|
| 116 | bilinear programs, hence YALMIP+<a href="solvers.htm#penbmi">PENBMI</a> |
---|
| 117 | can be used to address general polynomial problems. |
---|
| 118 | <!-- <p><img border="0" src="demoicon.gif" width="16" height="16">You can |
---|
| 119 | actually (try to...) solve the BMI above without PENBMI. The internal solver <code>'bmilin'</code> is one |
---|
| 120 | alternative. Note though that this solver is slow and unstable. It is |
---|
| 121 | based on a simple sequential linearization approach with a |
---|
| 122 | trust-region, and is merely implemented to show how a simple |
---|
| 123 | BMI-solver can be coded using a few lines of YALMIP code. For more |
---|
| 124 | information, check out Example 14 in |
---|
| 125 | <a href="reference.htm#yalmipdemo">yalmipdemo</a>.--> |
---|
| 126 | </td> |
---|
| 127 | </tr> |
---|
| 128 | </table> |
---|
| 129 | |
---|
| 130 | </div> |
---|
| 131 | |
---|
| 132 | </body> |
---|
| 133 | |
---|
| 134 | </html> |
---|