MATLAB |
%of_syn_lmi6.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;
%-----
setlmis([]);
gam=lmivar(1,[1 0]);
R=lmivar(1,[2 1]);
S=lmivar(1,[2 1]);
Ak=lmivar(2,[2 2]);
Bk=lmivar(2,[2 1]);
Ck=lmivar(2,[1 2]);
Dk=lmivar(2,[1 1]);
%-----
lmiRS=newlmi;
lmiterm([lmiRS 1 1 R],A,1,'s'); %#1:R*A'+AR
lmiterm([lmiRS 1 1 Ck],B2,1,'s'); %#1:Ck'*B2'+B2*Ck
lmiterm([lmiRS 2 1 0],A'); %#1:A'
lmiterm([lmiRS 2 1 Ak],1,1); %#1:Ak
lmiterm([lmiRS 2 1 -Dk],C2',B2'); %#1:C2'*Dk'*B2'
lmiterm([lmiRS 2 2 S],1,A,'s'); %#1:A'*S+S*A
lmiterm([lmiRS 2 2 Bk],1,C2,'s'); %#1:C2'*Bk'+Bk*C2
lmiterm([lmiRS 1 3 0],B1); %#1:B1
lmiterm([lmiRS 1 3 Dk],B2,D21); %#1:B2*Dk*D21
lmiterm([lmiRS 2 3 S],1,B1); %#1:S*B1
lmiterm([lmiRS 2 3 Bk],1,D21); %#1:Bk*D21
lmiterm([lmiRS 3 3 gam],-1,1); %#1:-gam
lmiterm([lmiRS 4 1 R],C1,1); %#1:C1*R
lmiterm([lmiRS 4 1 Ck],D12,1); %#1:D12*Ck
lmiterm([lmiRS 4 2 0],C1); %#1:C1
lmiterm([lmiRS 4 2 Dk],D12,C2); %#1:D12*Dk*C2
lmiterm([lmiRS 4 3 0],D11); %#1:D11
lmiterm([lmiRS 4 3 Dk],D12,D21); %#1:D12*Dk*D21
lmiterm([lmiRS 4 4 gam],-1,1); %#1:-gam
%-----
alpha=0.1;
lmiPL1=newlmi;
lmiterm([lmiPL1 1 1 R],A,1,'s'); %#2:R*A'+A*R
lmiterm([lmiPL1 1 1 Ck],B2,1,'s'); %#2:Ck'*B2'+B2*Ck
lmiterm([lmiPL1 2 1 Ak],1,1); %#2:Ak
lmiterm([lmiPL1 1 2 0],A); %#2:A
lmiterm([lmiPL1 1 2 Dk],B2,C2); %#2:B2*Dk*C2
lmiterm([lmiPL1 2 2 S],1,A,'s'); %#2:A'*S+S*A
lmiterm([lmiPL1 2 2 Bk],1,C2,'s'); %#2:C2'*Bk'+Bk*C2
%
lmiterm([lmiPL1 1 1 R],2*alpha,1); %#2:2*alpha*R
lmiterm([lmiPL1 2 1 0],2*alpha); %#2:2*alpha*I
lmiterm([lmiPL1 2 2 S],2*alpha,1); %#2:2*alpha*S
%-----
r=2;
lmiPL2=newlmi;
lmiterm([lmiPL2 1 1 R],-r,1); %#3:-r*R
lmiterm([lmiPL2 2 1 0],-r); %#3:-r*I
lmiterm([lmiPL2 2 2 S],-r,1); %#3:-r*S
%
lmiterm([lmiPL2 1 3 R],A,1); %#3:A*R
lmiterm([lmiPL2 1 3 Ck],B2,1); %#3:B2*Ck
lmiterm([lmiPL2 2 3 Ak],1,1); %#3:Ak
lmiterm([lmiPL2 1 4 0],A); %#3:A
lmiterm([lmiPL2 1 4 Dk],B2,C2); %#3:B2*Dk*C2
lmiterm([lmiPL2 2 4 S],1,A); %#3:S*A
lmiterm([lmiPL2 2 4 Bk],1,C2); %#3:Bk*C2
%
lmiterm([lmiPL2 3 3 R],-r,1); %#3:-r*R
lmiterm([lmiPL2 4 3 0],-r); %#3:-r*I
lmiterm([lmiPL2 4 4 S],-r,1); %#3:-r*S
%-----
th=0.4*pi; sth=sin(th); cth=cos(th);
lmiPL3=newlmi;
lmiterm([lmiPL3 1 1 R],sth*A,1,'s'); %#4:sth*(R*A'+A*R)
lmiterm([lmiPL3 1 1 Ck],sth*B2,1,'s');%#4:sth*(Ck'*B2'+B2*Ck)
lmiterm([lmiPL3 2 1 Ak],sth,1); %#4:sth*(Ak)
lmiterm([lmiPL3 1 2 0],sth*A); %#4:sth*(A)
lmiterm([lmiPL3 1 2 Dk],sth*B2,C2); %#4:sth*(B2*Dk*C2)
lmiterm([lmiPL3 2 2 S],1,sth*A,'s'); %#4:sth*(A'*S+S*A)
lmiterm([lmiPL3 2 2 Bk],1,sth*C2,'s');%#4:sth*(C2'*Bk'+Bk*C2)
%
% lmiterm([lmiPL3 1 3 R],1,cth*A'); %#4:cth*(R*A')
% lmiterm([lmiPL3 1 3 R],-cth*A,1); %#4:cth*(-A*R)
% lmiterm([lmiPL3 1 3 -Ck],cth*B2',1);%#4:cth*(Ck'*B2')
% lmiterm([lmiPL3 1 3 Ck],-cth*B2,1); %#4:cth*(-B2*Ck)
lmiterm([lmiPL3 1 3 R],cth*A,1); %#1:cth*(A*R)
lmiterm([lmiPL3 1 3 R],1,-cth*A'); %#1:cth*(-R*A')
lmiterm([lmiPL3 1 3 Ck],cth*B2,1); %#1:cth*(B*Ck)
lmiterm([lmiPL3 1 3 -Ck],-cth*B2',1); %#1:cth*(-Ck'*B')
lmiterm([lmiPL3 2 3 Ak],cth,1); %#4:cth*(Ak)
lmiterm([lmiPL3 1 4 -Ak],-cth,1); %#4:cth*(-Ak')
lmiterm([lmiPL3 1 4 0],A); %#4:cth*(A)
lmiterm([lmiPL3 2 3 0],-A'); %#4:cth*(-A')
lmiterm([lmiPL3 1 4 Dk],cth*B2,C2); %#4:cth*(B2*Dk*C2)
lmiterm([lmiPL3 2 3 -Dk],-cth*C2',B2');%#4:cth*(-C2'*Dk'*B2')
lmiterm([lmiPL3 2 4 S],1,cth*A); %#4:cth*(S*A)
lmiterm([lmiPL3 2 4 S],-cth*A',1); %#4:cth*(-A'*S)
lmiterm([lmiPL3 2 4 Bk],1,cth*C2); %#4:cth*(Bk*C2)
lmiterm([lmiPL3 2 4 -Bk],-cth*C2',1); %#4:cth*(-C2'*Bk')
%
lmiterm([lmiPL3 3 3 R],sth*A,1,'s'); %#4:sth*(R*A'+A*R)
lmiterm([lmiPL3 3 3 Ck],sth*B2,1,'s');%#4:sth*(Ck'*B2'+B2*Ck)
lmiterm([lmiPL3 4 3 Ak],sth,1); %#4:sth*(Ak)
lmiterm([lmiPL3 3 4 0],sth*A); %#4:sth*(A)
lmiterm([lmiPL3 3 4 Dk],sth*B2,C2); %#4:sth*(B2*Dk*C2)
lmiterm([lmiPL3 4 4 S],1,sth*A,'s'); %#4:sth*(A'*S+S*A)
lmiterm([lmiPL3 4 4 Bk],1,sth*C2,'s');%#4:sth*(C2'*Bk'+Bk*C2)
%-----
posX=-newlmi;
lmiterm([posX 1 1 R],1,1); %#5:R
lmiterm([posX 2 1 0],1); %#5:I
lmiterm([posX 2 2 S],1,1); %#5:S
%-----
lmiDk=-newlmi;
lmiterm([lmiDk 1 1 0],1e2); %#6:1e2
lmiterm([lmiDk 2 2 0],1e2); %#6:1e2
lmiterm([lmiDk 2 1 Dk],1,1); %#6:Dk
%-----
lmig=newlmi;
lmiterm([lmig,1,1,gam],1,1); %#7:gam
lmiterm([lmig,1,1,0],-1e3); %#7:1e3
%-----
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-B2*dk*C2)*R-bk*C2*R-S*B2*ck)*Mti;
BK=Ni*(bk-S*B2*dk);
CK=(ck-dk*C2*R)*Mti;
DK=dk;
%-----
pl=eig(A)
ACL=[A+B2*DK*C2 B2*CK;
BK*C2 AK];
plCL=eig(ACL)
close all,figure(1)
dregion(alpha,0,r,th,r*[-1,1,-1,1])
plot(real(pl),imag(pl),'x',real(plCL),imag(plCL),'*')
BCL=[B1+B2*DK*D21;
BK*D21];
CCL=[C1+D12*DK*C2 D12*CK];
DCL=D11+D12*DK*D21;
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
|