MATLAB |
%ana_lmi4.m
%-----
clear all, close all
A=[0 1;-2 -3]; n=2;
%-----
setlmis([]);
X=lmivar(1,[n 1]);
%-----
alpha=0.5;
lmi1=newlmi;
lmiterm([lmi1 1 1 X],1,A,'s'); %#1:XA+A'*X
lmiterm([lmi1,1,1,X],2*alpha,1); %#1:2*alpha*X
%
q=0; r=3;
lmi2=newlmi;
lmiterm([lmi2 1 1 X],-r,1); %#2:
lmiterm([lmi2 1 2 X],1,A); %#2:2*alpha*X
lmiterm([lmi2 2 2 X],-r,1); %#2:
%
th=pi/4; sth=sin(th); cth=cos(th);
lmi3=newlmi;
lmiterm([lmi3 1 1 X],1,sth*A,'s'); %#3:sth*(X*A+A'*X)
lmiterm([lmi3 1 2 X],1,cth*A); %#3:cth*X*A
lmiterm([lmi3 1 2 X],-cth*A',1); %#3:-cth*A'*X
lmiterm([lmi3 2 2 X],1,sth*A,'s'); %#3:sth*(X*A+A'*X)
%
lmi4=newlmi;
lmiterm([-lmi4 1 1 X],1,1); %#4:X
%-----
LMIs=getlmis;
[tmin,xfeas]=feasp(LMIs);
X=dec2mat(LMIs,xfeas,X)
%-----
%eof
|