source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/demos/bmiex3.m @ 86

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

Added original make3d

File size: 1.3 KB
Line 
1
2echo on
3clc
4% This example shows how BMIs can be locally solved using
5% a simple alternating scheme.
6%
7% The problem is to find a feedback u = Lx so that the
8% L2 gain from w to y is minimized, for the system
9%
10% x' = Ax+Bu+Gw
11% y  = Cx
12%
13% This can be formulated as the BMI
14%
15% min t
16% s.t                                 P > 0
17%     [(A+BL)P+P(A+BL)+C'C PG; G'P -tI] < 0
18%
19pause
20clc
21
22% Create system data
23A = [-1    -1    -1;
24     1     0     0;
25     0     1     0];
26B = [1;0;0];
27C = [0 0 1];
28G = [-1;-1;-1];
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% Fix L and optimize Lyapunov matrix P
45F = set([(A+B*double(L))'*P+P*(A+B*double(L))+C'*C P*G;G'*P -t]<0);
46F = F + set(P>0);
47pause
48solvesdp(F,t)
49double(t)
50pause
51   
52% Fix Lyapunov matrix P and optimize L
53F = set([(A+B*L)'*double(P)+double(P)*(A+B*L)+C'*C double(P)*G;G'*double(P) -t]<0);
54pause
55solvesdp(F,t)
56double(t)
57pause
58
59% and again...
60F = set([(A+B*double(L))'*P+P*(A+B*double(L))+C'*C P*G;G'*P -t]<0);
61F = F + set(P>0);
62solvesdp(F,t)
63double(t)
64pause
65   
66% and again...
67F = set([(A+B*L)'*double(P)+double(P)*(A+B*L)+C'*C double(P)*G;G'*double(P) -t]<0);
68solvesdp(F,t)
69double(t)
70pause
71echo off
Note: See TracBrowser for help on using the repository browser.