source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/demos/bmiex1.m @ 37

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

Added original make3d

File size: 920 bytes
Line 
1echo on
2clc
3% This example shows how to solve a simple BMI using PENBMI
4%
5% The problem is to find a feedback u = Lx so that the
6% L2 gain from w to y is minimized, for the system
7%
8% x' = Ax+Bu+Gw
9% y  = Cx
10%
11% This can be formulated as the BMI
12%
13% min t
14% s.t                                 P > 0
15%     [(A+BL)P+P(A+BL)+C'C PG; G'P -tI] < 0
16%
17pause
18clc
19
20% Create system data
21A = [-1    -1    -1;
22     1     0     0;
23     0     1     0];
24B = [1;0;0];
25C = [0 0 1];
26G = [-1;-1;-1];
27
28pause
29
30% Define decision variables
31P = sdpvar(3,3);
32L = sdpvar(1,3);
33t = sdpvar(1,1);
34pause
35
36% A reasonble initial guess is valuable
37[L0,P0]=lqr(A,B,eye(3),1);
38setsdpvar(P,P0);
39setsdpvar(L,-L0);
40setsdpvar(t,100);
41pause
42clc
43
44% Define the BMI
45F = set([(A+B*L)'*P+P*(A+B*L)+C'*C P*G;G'*P -t]<0) + set(P>0)
46pause
47
48% Solve, using the initial guess on P, L and t
49solvesdp(F,t,sdpsettings('solver','penbmi','usex0',1))
50double(L)
51pause
52echo off
Note: See TracBrowser for help on using the repository browser.