MATLAB |
%sf_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];
A=1; B1=1; B2=B1;
C1=[1;0]; D11=[0;0]; D12=[0;1];
[n,m]=size(B2); p=1;
%-----
setlmis([]);
gam=lmivar(1,[1 0]);
Q=lmivar(1,[p 1]);
Y=lmivar(1,[n 1]);
Z=lmivar(2,[m n]);
%-----
lmi1=newlmi;
lmiterm([lmi1,1,1,Y],A,1,'s'); %#1:A*Y+Y*A'
lmiterm([lmi1,1,1,Z],-B2,1,'s'); %#1:-B2*Z-Z*B2'
lmiterm([lmi1,1,2,0],B1); %#1:B1
lmiterm([lmi1,2,2,0],-1); %#1:-I
%-----
lmi2=newlmi;
lmiterm([-lmi2,1,1,Y],1,1); %#2:Y
lmiterm([-lmi2,2,1,Y],C1,1); %#2:C1*Y
lmiterm([-lmi2,2,1,Z],-D12,1); %#2:-D12*Z
lmiterm([-lmi2,2,2,Q],1,1); %#2:Q
%----- 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);
gam=dec2mat(LMIs,xopt,gam)
Q=dec2mat(LMIs,xopt,Q)
Y=dec2mat(LMIs,xopt,Y)
Z=dec2mat(LMIs,xopt,Z)
F=Z/Y
[Fopt,plopt]=opt(A,B1,C1(1,:),1,1)
%-----
pl=eig(A-B2*F)
close all,figure(1)
dregion(0,0,20,pi/4,20*[-1,1,-1,1])
plot(real(pl),imag(pl),'*')
figure(2)
ol=ltisys(A,B1,C1,D11);
cl=ltisys(A-B2*F,B1,C1-D12*F,D11);
om=logspace(-2,2,200);
splot(ssub(cl,1,1),'sv',om),hold on
splot(ssub(ol,1,1),'sv',om),grid
%-----
%eof
|