MATLAB |
%cSPIN_sf_gs.m
%-----
clear all close all
J1=1; J2=1; J3=0.5;
OMnom=2*pi; OMmin=0*OMnom; OMmax=2*OMnom;
A1=[0 (J2-J3)/J1;(J3-J1)/J2 0];
B=diag([1/J1 1/J2]); C=eye(2); D=zeros(2,2);
S0=[zeros(2,2) B;C D];
S1=zeros(4,4); S1(1:2,1:2)=A1;
%-----
J1=1; J2=1; J3=0.5;
OMnom=2*pi; OMmin=0*OMnom; OMmax=2*OMnom;
A1= OMmin*[0 (J2-J3)/J1;(J3-J1)/J2 0];
A2= OMmax*[0 (J2-J3)/J1;(J3-J1)/J2 0];
B=diag([1/J1 1/J2]);
B1=B; B2=B;
C1=[eye(2,2);zeros(2,2)];
D11=zeros(4,2);
D12=[zeros(2,2);eye(2,2)];
alpha=1; r=3; th=pi/4;
LMIs=sf_synlmi7(A1,A2,B1,B2,C1,D11,D12,alpha,r,th);
cobj=zeros(1,decnbr(LMIs));
cobj(1)=1;
[cost,xopt]=mincx(LMIs,cobj);
Y=dec2mat(LMIs,xopt,2);
Z1=dec2mat(LMIs,xopt,3);
Z2=dec2mat(LMIs,xopt,4);
F1=Z1/Y,pl1=eig(A1-B2*F1)
F2=Z2/Y,pl2=eig(A2-B2*F2)
%------
figure(1)
subplot(121),dregion(alpha,0,r,th,7*[-1,1,-1,1])
plot(real(pl1),imag(pl1),'*')
subplot(122), dregion(alpha,0,r,th,7*[-1,1,-1,1])
plot(real(pl2),imag(pl2),'*')
%------
prange=OMmax-OMmin; pmax=OMmax; pmin=OMmin;
sim("SPIN_sf_gs")
%-----
function LMIs=sf_synlmi7(A1,A2,B1,B2,C1,D11,D12,alpha,r,th)
[n,m]=size(B2);
sth=sin(th); cth=cos(th);
setlmis([]);
gam=lmivar(1,[1 0]);
Y=lmivar(1,[n 1]);
Z1=lmivar(2,[m n]);
Z2=lmivar(2,[m n]);
%
lmi11=newlmi;
lmiterm([lmi11,1,1,Y],A1,1,'s'); %#1:A*Y+Y*A'
lmiterm([lmi11,1,1,Z1],-B2,1,'s'); %#1:-(B2*Z+Z*B2')
lmiterm([lmi11,1,2,0],B1); %#1:B1
lmiterm([lmi11,2,2,gam],-1,1); %#1:-gam
lmiterm([lmi11,3,1,Y],C1,1); %#1:C1*Y
lmiterm([lmi11,3,1,Z1],-D12,1); %#1:D12*Z
lmiterm([lmi11,3,2,0],D11); %#1:D11
lmiterm([lmi11,3,3,gam],-1,1); %#1:-gam
lmi21=newlmi;
lmiterm([lmi21,1,1,Y],A1,1,'s'); %#2:A*Y+Y*A'
lmiterm([lmi21,1,1,Z1],-B2,1,'s'); %#2:-(B2*Z+Z'*B2')
lmiterm([lmi21,1,1,Y],2*alpha,1); %#2:2*alpha*Y
lmi31=newlmi;
lmiterm([lmi31,1,1,Y],-r,1); %#3:-r*Y
lmiterm([lmi31,1,2,Y],A1,1); %#3:A*Y
lmiterm([lmi31,1,2,Z1],-B2,1); %#3:-B2*Z
lmiterm([lmi31,2,2,Y],-r,1); %#3:-r*Y
lmi41=newlmi;
lmiterm([lmi41,1,1,Y],sth*A1,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi41,1,1,Z1],-sth*B2,1,'s');%#4:-sth*(B2*Z+Z'*B2')
lmiterm([lmi41,1,2,Y],cth*A1,1); %#4:cth*A*Y
lmiterm([lmi41,1,2,Y],1,-cth*A1'); %#4:-cth*Y*A'
lmiterm([lmi41,1,2,Z1],-cth*B2,1); %#4:-cth*B2*Z
lmiterm([lmi41,1,2,-Z1],1,cth*B2'); %#4:cth*Z'*B2'
lmiterm([lmi41,2,2,Y],sth*A1,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi41,2,2,Z1],-sth*B2,1,'s');%#4:-sth*(B2*Z+Z'*B2')
%
lmi12=newlmi;
lmiterm([lmi12,1,1,Y],A2,1,'s'); %#1:A*Y+Y*A'
lmiterm([lmi12,1,1,Z2],-B2,1,'s'); %#1:-(B2*Z+Z*B2')
lmiterm([lmi12,1,2,0],B1); %#1:B1
lmiterm([lmi12,2,2,gam],-1,1); %#1:-gam
lmiterm([lmi12,3,1,Y],C1,1); %#1:C1*Y
lmiterm([lmi12,3,1,Z2],-D12,1); %#1:D12*Z
lmiterm([lmi12,3,2,0],D11); %#1:D11
lmiterm([lmi12,3,3,gam],-1,1); %#1:-gam
lmi22=newlmi;
lmiterm([lmi22,1,1,Y],A2,1,'s'); %#2:A*Y+Y*A'
lmiterm([lmi22,1,1,Z2],-B2,1,'s'); %#2:-(B2*Z+Z'*B2')
lmiterm([lmi22,1,1,Y],2*alpha,1); %#2:2*alpha*Y
lmi32=newlmi;
lmiterm([lmi32,1,1,Y],-r,1); %#3:-r*Y
lmiterm([lmi32,1,2,Y],A2,1); %#3:A*Y
lmiterm([lmi32,1,2,Z2],-B2,1); %#3:-B2*Z
lmiterm([lmi32,2,2,Y],-r,1); %#3:-r*Y
lmi42=newlmi;
lmiterm([lmi42,1,1,Y],sth*A2,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi42,1,1,Z2],-sth*B2,1,'s');%#4:-sth*(B2*Z+Z'*B2')
lmiterm([lmi42,1,2,Y],cth*A2,1); %#4:cth*A*Y
lmiterm([lmi42,1,2,Y],1,-cth*A2'); %#4:-cth*Y*A'
lmiterm([lmi42,1,2,Z2],-cth*B2,1); %#4:-cth*B2*Z
lmiterm([lmi42,1,2,-Z2],1,cth*B2'); %#4:cth*Z'*B2'
lmiterm([lmi42,2,2,Y],sth*A2,1,'s'); %#4:sth*(A*Y+Y*A')
lmiterm([lmi42,2,2,Z2],-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;
end
%-----
%eof
|