source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/htmldata/complex.htm @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 4.0 KB
Line 
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 : Complex-valued problems</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 
22           <h2>Complex-valued problems</h2>
23    <hr noShade SIZE="1">
24    <p>YALMIP supports complex valued constraints for all solvers by
25    automatically converting complex-valued problems to real-valued problems.</p>
26    <p>To begin with,&nbsp;let us just define a simple linear complex problem to
27    illustrate how complex variables and constraints are generated and
28    interpreted.</p>
29    <table cellPadding="10" width="100%">
30      <tr>
31        <td class="xmpcode">
32        <pre>p = sdpvar(1,1,'full','complex');&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; % A complex scalar (4 arguments necessary)
33s = sdpvar(1,1)+sqrt(-1)*sdpvar(1,1);&nbsp; % Alternative definition
34F = set('0.9&gt;imag(p)');                % Imaginary part constrained
35F = F+set('0.01&gt;real(p)');             % Real part constrained
36
37F = F+set('0.1+0.5*sqrt(-1)&gt;p');       % Both parts constrained
38
39F = F+set('s+p==2+4*sqrt(-1)');        % Both parts constrained</pre>
40        </td>
41      </tr>
42    </table>
43    <p>To see how complex-valued constraints can be used in a more advanced
44    setting,&nbsp;we solve the covariance estimation problem from the&nbsp;<a href="solvers.htm#sedumi">SeDuMi</a> 
45    manual. The problem is to find a positive-definite Hermitian Toeplitz matrix
46    <b>Z</b> such that the Frobenious norm of <b><font face="Tahoma">P-Z</font></b> is minimized (<b><font face="Tahoma">P</font></b> is a given complex
47    matrix.)</p>
48    <p>The matrix <b>P</b> is</p>
49    <table cellPadding="10" width="100%">
50      <tr>
51        <td class="xmpcode">
52        <pre>P = [4 1+2*i 3-i;1-2*i 3.5 0.8+2.3*i;3+i 0.8-2.3*i 4];</pre>
53        </td>
54      </tr>
55    </table>
56    <p>We define a complex-valued&nbsp;Toeplitz matrix of the corresponding dimension</p>
57    <table cellPadding="10" width="100%">
58      <tr>
59        <td class="xmpcode">
60        <pre>Z = sdpvar(3,3,'toeplitz','complex')</pre>
61        </td>
62      </tr>
63    </table>
64    <p>A complex Toeplitz matrix is not Hermitian, but we can make it Hermitian
65    if we remove the imaginary part on the diagonal.</p>
66    <table cellPadding="10" width="100%">
67      <tr>
68        <td class="xmpcode">
69        <pre>Z = Z-diag(imag(diag(Z)))*sqrt(-1);</pre>
70        </td>
71      </tr>
72    </table>
73    <p>Minimizing the Frobenious norm of <b><font face="Tahoma">P-Z</font></b> can be cast as minimizing the
74    Euclidean norm of the vectorized difference <b><font face="Tahoma">P(:)-Z(:)</font></b>. By using a Schur
75    complement, we see that this can be written as the following SDP.</p>
76    <table cellPadding="10" width="100%">
77      <tr>
78        <td class="xmpcode">
79        <pre>e = P(:)-Z(:)
80t = sdpvar(1,1);
81F = set(Z&gt;0);
82F = F+set([t e';e eye(9)]&gt;0);
83solvesdp(F,t);</pre>
84        </td>
85      </tr>
86    </table>
87    <p>The problem can be implemented more efficiently using a second order cone
88    constraint.</p>
89    <table cellPadding="10" width="100%">
90      <tr>
91        <td class="xmpcode">
92        <pre>e = Z(:)-P(:)
93t = sdpvar(1,1);
94F = set(Z&gt;0);
95F = F+set(cone(e,t));
96solvesdp(F,t);</pre>
97        </td>
98      </tr>
99    </table>
100    <p>...or by using a quadratic objective function</p>
101    <table cellPadding="10" width="100%">
102      <tr>
103        <td class="xmpcode">
104        <pre>e = Z(:)-P(:)
105F = set(Z&gt;0);
106solvesdp(F,e'*e);</pre>
107        </td>
108      </tr>
109    </table>
110    </td>
111  </tr>
112</table>
113
114</div>
115
116</body>
117
118</html>
Note: See TracBrowser for help on using the repository browser.