MATLAB |
%sf_syn_lmi6.m
%-----
clear all, close all
A=[0 1;-1 -2*0.01]; B1=[0;1]; B2=B1;
C1=[1 0;0 0]; D11=[0;0]; D12=[0;1];
[n,m]=size(B2);
%-----
setlmis([]);
gam=lmivar(1,[1 0]);
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,gam],-1,1); %#1:-gam
lmiterm([lmi1,3,1,Y],C1,1); %#1:C1*Y
lmiterm([lmi1,3,1,Z],-D12,1); %#1:D12*Z
lmiterm([lmi1,3,2,0],D11); %#1:D11
lmiterm([lmi1,3,3,gam],-1,1); %#1:-gam
%-----
alpha=0.1;
lmi2=newlmi;
lmiterm([lmi2,1,1,Y],A,1,'s'); %#2:A*Y+Y*A'
lmiterm([lmi2,1,1,Z],-B2,1,'s'); %#2:-(B2*Z+Z'*B2')
lmiterm([lmi2,1,1,Y],2*alpha,1); %#2:2*alpha*Y
%-----
r=2;
lmi3=newlmi;
lmiterm([lmi3,1,1,Y],-r,1); %#3:-r*Y
lmiterm([lmi3,1,2,Y],A,1); %#3:A*Y
lmiterm([lmi3,1,2,Z],-B2,1); %#3:-B2*Z
lmiterm([lmi3,2,2,Y],-r,1); %#3:-r*Y
%-----
theta=pi/4; sth=sin(theta); cth=cos(theta);
lmi4=newlmi;
lmiterm([lmi4,1,1,Y],sth*A,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi4,1,1,Z],-sth*B2,1,'s');%#4:-sth*(B2*Z+Z'*B2')
lmiterm([lmi4,1,2,Y],cth*A,1); %#4:cth*A*Y
lmiterm([lmi4,1,2,Y],1,-cth*A'); %#4:-cth*Y*A'
lmiterm([lmi4,1,2,Z],-cth*B2,1); %#4:-cth*B2*Z
lmiterm([lmi4,1,2,-Z],1,cth*B2'); %#4:cth*Z'*B2'
lmiterm([lmi4,2,2,Y],sth*A,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi4,2,2,Z],-sth*B2,1,'s');%#4:-sth*(B2*Z+Z'*B2')
%-----
lmi5=newlmi;
lmiterm([-lmi5,1,1,Y],1,1); %#5:Y
%-----
lmi6=newlmi;
lmiterm([lmi6,1,1,gam],1,1); %#6:gam
lmiterm([-lmi6,1,1,0],1e3); %#6:1000
%-----
LMIs=getlmis;
cobj=zeros(1,decnbr(LMIs));
cobj(1)=1;
[cost,xopt]=mincx(LMIs,cobj);
gopt=dec2mat(LMIs,xopt,gam);
Y=dec2mat(LMIs,xopt,Y);
Z=dec2mat(LMIs,xopt,Z);
F=Z/Y;
%-----
pl=eig(A-B2*F)
close all,figure(1)
dregion(alpha,0,r,theta,r*[-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
|