However , if i use self toolbox to solve these LMI, it gives me a solution. And the Y,K, and P are explicit value.
I donot know why it makes difference. In the former, why did the result return a NaN value? Where i can change in the code for eliminating the NaN value in the YALMIP? Can you help me?
A = 1.0e+04 * [ 0 0.0001 -0.0000 0 0;
-0.0022 -0.0000 0.0000 0 0;
1.6744 0.0120 -0.0001 0 -0.0000;
0 0 0 -0.0010 0;
0 0 0 0 -0.0010];
B = [ 0 0 0 10 0;
0 0 0 0 10]';
C = [ 0 1 0 0 0;
0 0 0 1 0];
D = [ 0 100 0 0 0]';
CD1=inv((C*D)'*(C*D))*(C*D)';
U=-D*CD1;
V=eye(2)-C*D*CD1;
%% step 1 calculate U V
CD1=inv((C*D)'*(C*D))*(C*D)';
U=-D*CD1;
V=eye(2)-C*D*CD1;
%% step2 Y K P
setlmis([])
nU=size(U);
nV=size(V);
n1=nU(1,1);
n2=nV(1,1);
I=eye(n1);
n1=5;
n2=2;
Y1=lmivar(2,[n1,n2]);
K1=lmivar(2,[n1,n2]);
P=lmivar(1,[n1,0]);
gam=10000;
t1=sqrt(gam);
lmiterm([1 1 1 P],((I+U*C)*A)',1,'s'); % LMI #1: ((I+U*C)*A)'*P+P*((I+U*C)*A)
lmiterm([1 1 1 -Y1],.5*(V*C*A)',1,'s'); % LMI #1: (V*C*A)'*Y1' (NON SYMMETRIC?)
lmiterm([1 1 1 Y1],.5*1,V*C*A,'s'); % LMI #1: Y1*V*C*A (NON SYMMETRIC?)
lmiterm([1 1 1 -K1],.5*C',-1,'s'); % LMI #1: -C'*K1'* (NON SYMMETRIC?)
lmiterm([1 1 1 K1],.5*1,-C,'s'); % LMI #1: -K1*C (NON SYMMETRIC?)
lmiterm([1 1 1 0],gam.*I); % LMI #1: gam.*I
lmiterm([1 1 2 Y1],1,t1.*V*C);
lmiterm([1 1 2 P],1,t1.*(I+U*C));
lmiterm([1 2 2 0],-I); % LMI #1: -I
lmiterm([-2 1 1 P],1,1); % LMI #2: P
lmi_o1=getlmis;
[tmin,xfeas]=feasp(lmi_o1)
Y1t=dec2mat(lmi_o1,xfeas,Y1)
K1t=dec2mat(lmi_o1,xfeas,K1)
Pt=dec2mat(lmi_o1,xfeas,P)
%% YALMIP
%%-------------------------------------------------------
gam=10000;
% step 1 calculate U V
CD1=inv((C*D)'*(C*D))*(C*D)';
U=-D*CD1;
V=eye(2)-C*D*CD1;
nU=size(U);
nV=size(V);
n1=nU(1,1);
n2=nV(1,1);
I=eye(n1);
n1=5;
n2=2;
Y1=sdpvar(n1,n2);
K1=sdpvar(n1,n2);
P=sdpvar(n1,n1);
t1=sqrt(gam);
S11=A'*(I+U*C)'*P+(V*C*A)'*Y1'-C'*K1'+P*(I*+U*C)*A+Y1*V*C*A-K1*C+gam*I;
S12=t1*P*(I+U*C)+t1*Y1*V*C;
S22=-I;
F=[P>0];
F=[F,[S11, S12; S12' S22]<0];
solvesdp(F);
Y=inv(value(P))*value(Y1);
K=inv(value(P))*value(K1);
}