Line | |
---|
1 | echo on |
---|
2 | clc |
---|
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 | % |
---|
17 | pause |
---|
18 | clc |
---|
19 | |
---|
20 | % Create system data |
---|
21 | A = [-1 -1 -1; |
---|
22 | 1 0 0; |
---|
23 | 0 1 0]; |
---|
24 | B = [1;0;0]; |
---|
25 | C = [0 0 1]; |
---|
26 | G = [-1;-1;-1]; |
---|
27 | |
---|
28 | pause |
---|
29 | |
---|
30 | % Define decision variables |
---|
31 | P = sdpvar(3,3); |
---|
32 | L = sdpvar(1,3); |
---|
33 | t = sdpvar(1,1); |
---|
34 | pause |
---|
35 | |
---|
36 | % A reasonble initial guess is valuable |
---|
37 | [L0,P0]=lqr(A,B,eye(3),1); |
---|
38 | setsdpvar(P,P0); |
---|
39 | setsdpvar(L,-L0); |
---|
40 | setsdpvar(t,100); |
---|
41 | pause |
---|
42 | clc |
---|
43 | |
---|
44 | % Define the BMI |
---|
45 | F = set([(A+B*L)'*P+P*(A+B*L)+C'*C P*G;G'*P -t]<0) + set(P>0) |
---|
46 | pause |
---|
47 | |
---|
48 | % Solve, using the initial guess on P, L and t |
---|
49 | solvesdp(F,t,sdpsettings('solver','penbmi','usex0',1)) |
---|
50 | double(L) |
---|
51 | pause |
---|
52 | echo off |
---|
Note: See
TracBrowser
for help on using the repository browser.