MATLAB |
%of_syn_lmi7.m
%-----
A=[0 1;-1 -2*0.01]; B1=[0;1]; B2=B1;
C1=[1 0;0 0]; D11=[0;0]; D12=[0;1];
C2=[1 0]; D21=0; D22=0;
[n,m]=size(B1); p=1;
%=====
setlmis([]);
gam=lmivar(1,[1 0]);
Q=lmivar(1,[p 1]);
R=lmivar(1,[n 1]);
S=lmivar(1,[n 1]);
Ak=lmivar(2,[n n]);
Bk=lmivar(2,[n p]);
Ck=lmivar(2,[m n]);
Dk=lmivar(2,[m p]);
%----- (15)
lmi1=newlmi;
lmiterm([lmi1 1 1 R],A,1,'s'); %#1:R*A'+AR
lmiterm([lmi1 1 1 Ck],B2,1,'s'); %#1:Ck'*B2'+B2*Ck
lmiterm([lmi1 2 1 0],A'); %#1:A'
lmiterm([lmi1 2 1 Ak],1,1); %#1:Ak
lmiterm([lmi1 2 2 S],1,A,'s'); %#1:A'*S+S*A
lmiterm([lmi1 2 2 Bk],1,C2,'s'); %#1:C2'*Bk'+Bk*C2
lmiterm([lmi1 1 3 0],B1); %#1:B1
lmiterm([lmi1 2 3 S],1,B1); %#1:S*B1
lmiterm([lmi1 2 3 Bk],1,D21); %#1:Bk*D21
lmiterm([lmi1 3 3 0],-1); %#1:-I
%----- (16)
lmi2=newlmi
lmiterm([-lmi2 1 1 R],1,1); %#2:R
lmiterm([-lmi2 2 1 0],1); %#2:I
lmiterm([-lmi2 2 2 S],1,1); %#2:S
lmiterm([-lmi2,3,1,R],C1,1); %#2:C1*R
lmiterm([-lmi2,3,1,Ck],D12,1); %#2:D12*Ck
lmiterm([-lmi2 3 3 Q],1,1); %#2:Q
%----- (17) gam-tr(Q)>0
CT=zeros(1,p*(p+1)/2);
for i=1:p, j=(i+1)*i/2; CT(j)=1; end
lmi3=newlmi;
lmiterm([-lmi3 1 1 gam],1,1); %#3:gam
lmiterm([-lmi3 1 1 Q],-CT,1); %#3:-tr(Q)
%======
LMIs=getlmis;
cobj=zeros(1,decnbr(LMIs));
cobj(1)=1;
[cost,xopt]=mincx(LMIs,cobj);
%-----
gopt=dec2mat(LMIs,xopt,gam)
R=dec2mat(LMIs,xopt,R);
S=dec2mat(LMIs,xopt,S);
ak=dec2mat(LMIs,xopt,Ak);
bk=dec2mat(LMIs,xopt,Bk);
ck=dec2mat(LMIs,xopt,Ck);
dk=dec2mat(LMIs,xopt,Dk);
[u,sd,v]=svd(eye(size(A,1)-S*R);
sd=diag(sqrt(1./diag(sd)));
Ni=sd*u'; Mti=v*sd;
AK=Ni*(ak-S*A*R-bk*C2*R-S*B2*ck)*Mti;
BK=Ni*bk;
CK=ck*Mti;
%-----
pl=eig(A)
ACL=[A B2*CK;
BK*C2 AK];
plCL=eig(ACL)
close all,figure(1)
dregion(0,0,2000,pi/2,2000*[-1,1,-1,1])
plot(real(pl),imag(pl),'x',real(plCL),imag(plCL),'*')
BCL=[B1;
BK*D21];
CCL=[C1 D12*CK];
DCL=zeros(2,1);
figure(2)
ol=ltisys(A,B1,C1,D11);
cl=ltisys(ACL,BCL,CCL,DCL);
om=logspace(-1,1,100);
splot(cl,'sv',om),hold on
splot(ol,'sv',om),grid
%-----
%eof
|