马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
您好,我在仿真一个LMI,总提示dec2mat这个函数错误,我觉得是LMI没有可行解导致的。做的方向是部分未知转移概率的Markov跳跃系统H-inf滤波器的设计。这是程序,麻烦帮我看一下,谢谢了。
clear all
A{1}=[2.72 -1.40;0.80 -0.80];
A{2}=[1.58 -0.36;0.80 -1.12];
A{3}=[0.76 -0.28;0.80 -0.96];
A{4}=[1.28 -0.38;0.80 -0.88];
B{1}=[2;1];
B{2}=[5;-6];
B{3}=[1;1];
B{4}=[0.8;-1];
C{1}=[0.1 0];
C{2}=C{1};
C{3}=C{1};
C{4}=C{1};
D{1}=0.2;
D{2}=0.2;
D{3}=0.2;
D{4}=0.2;
H{1}=[0.1 0.1];
H{2}=H{1};
H{3}=H{1};
H{4}=H{1};
LMD=[-1.3 0.2 0.8 0.3;
0.3 -0.9 0.3 0.3;
0.6 0.6 -1.5 0.3;
0.4 0.2 0.6 -1.2];
L{1}=LMD(1,1)+LMD(1,2);
L{2}=LMD(2,3)+LMD(2,4);
L{3}=LMD(3,1)+LMD(3,3);
L{4}=LMD(4,4);
setlmis([])
for k=1:1:4
X1{k}=lmivar(1,[2 1]);
X2{k}=lmivar(1,[2 1]);
Y{k}=lmivar(2,[2 2]);
Z{k}=lmivar(2,[2 1]);
W{k}=lmivar(2,[1 2]);
end
r_square=lmivar(1,[1 1]);
i=1;
k=1;
%**********************11111111***********
% Conditions for Known parts
Fir{k}=newlmi;
lmiterm([ Fir{k} 1 1 X1{i}],A{i},1+L{i},'s');
lmiterm([ Fir{k} 1 1 X1{i}],LMD(i,1),1);
lmiterm([ Fir{k} 1 2 -Z{i}],C{i}',1+L{i});
lmiterm([ Fir{k} 1 3 X1{i}],1,B{i});
lmiterm([ Fir{k} 1 4 0],H{i}');
lmiterm([ Fir{k} 1 5 X1{2}],sqrt(LMD(i,2)),1);
lmiterm([ Fir{k} 2 2 Y{i}],1,1+L{i},'s');
lmiterm([ Fir{k} 2 2 X2{i}],LMD(i,1),1);
lmiterm([ Fir{k} 2 3 Z{i}],1,D{i});
lmiterm([-Fir{k} 2 4 -W{i}],1,1);
lmiterm([ Fir{k} 2 6 X2{2}],sqrt(LMD(i,2)),1);
lmiterm([-Fir{k} 3 3 r_square],1,1);
lmiterm([-Fir{k} 4 4 0],1);
lmiterm([-Fir{k} 5 5 X1{2}],1,1);
lmiterm([-Fir{k} 6 6 X2{2}],1,1);
% conditions for unknown parts
Sen{k}=newlmi;
lmiterm([ Sen{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen{k} 1 1 X1{3}],1,1);
lmiterm([ Sen{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen{k} 2 2 X2{3}],1,1);
Sen1{k}=newlmi;
lmiterm([ Sen1{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen1{k} 1 1 X1{4}],1,1);
lmiterm([ Sen1{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen1{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen1{k} 2 2 X2{4}],1,1);
%**********************************
i=i+1;
k=k+1;
%**************** 2222222 ******
% Conditions for Known parts
Fir{k}=newlmi;
lmiterm([ Fir{k} 1 1 X1{i}],A{i},1+L{i},'s');
lmiterm([ Fir{k} 1 2 -Z{i}],C{i}',1+L{i});
lmiterm([ Fir{k} 1 3 X1{i}],1,B{i});
lmiterm([ Fir{k} 1 4 0],H{i}');
lmiterm([ Fir{k} 1 5 X1{3}],sqrt(LMD(i,3)),1);
lmiterm([ Fir{k} 1 7 X1{4}],sqrt(LMD(i,4)),1);
lmiterm([ Fir{k} 2 2 Y{i}],1,1+L{i},'s');
lmiterm([ Fir{k} 2 3 Z{i}],1,D{i});
lmiterm([-Fir{k} 2 4 -W{i}],1,1);
lmiterm([ Fir{k} 2 6 X2{3}],sqrt(LMD(i,3)),1);
lmiterm([ Fir{k} 2 8 X2{4}],sqrt(LMD(i,4)),1);
lmiterm([-Fir{k} 3 3 r_square],1,1);
lmiterm([-Fir{k} 4 4 0],1);
lmiterm([-Fir{k} 5 5 X1{3}],1,1);
lmiterm([-Fir{k} 6 6 X2{3}],1,1);
lmiterm([-Fir{k} 7 7 X1{4}],1,1);
lmiterm([-Fir{k} 8 8 X2{4}],1,1);
% conditions for unknown parts
Sen{k}=newlmi;
lmiterm([ Sen{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen{k} 1 1 X1{1}],1,1);
lmiterm([ Sen{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen{k} 2 2 X2{1}],1,1);
Sen1{k}=newlmi;
lmiterm([ -Sen1{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ -Sen1{k} 1 1 X1{2}],1,1);
lmiterm([ -Sen1{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ -Sen1{k} 2 2 Y{i}],1,1,'s');
lmiterm([ -Sen1{k} 2 2 X2{2}],1,1);
%************************************************
i=i+1;
k=k+1;
%**************** 3333 *****************
% Conditions for Known parts
Fir{k}=newlmi;
lmiterm([ Fir{k} 1 1 X1{i}],A{i},1+L{i},'s');
lmiterm([ Fir{k} 1 1 X1{i}],LMD(i,3),1);
lmiterm([ Fir{k} 1 2 -Z{i}],C{i}',1+L{i});
lmiterm([ Fir{k} 1 3 X1{i}],1,B{i});
lmiterm([ Fir{k} 1 4 0],H{i}');
lmiterm([ Fir{k} 1 5 X1{1}],sqrt(LMD(i,1)),1);
lmiterm([ Fir{k} 2 2 Y{i}],1,1+L{i},'s');
lmiterm([ Fir{k} 2 2 X2{i}],LMD(i,3),1);
lmiterm([ Fir{k} 2 3 Z{i}],1,D{i});
lmiterm([-Fir{k} 2 4 -W{i}],1,1);
lmiterm([ Fir{k} 2 6 X2{1}],sqrt(LMD(i,1)),1);
lmiterm([-Fir{k} 3 3 r_square],1,1);
lmiterm([-Fir{k} 4 4 0],1);
lmiterm([-Fir{k} 5 5 X1{1}],1,1);
lmiterm([-Fir{k} 6 6 X2{1}],1,1);
% conditions for unknown parts
Sen{k}=newlmi;
lmiterm([ Sen{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen{k} 1 1 X1{4}],1,1);
lmiterm([ Sen{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen{k} 2 2 X2{4}],1,1);
Sen1{k}=newlmi;
lmiterm([ Sen1{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen1{k} 1 1 X1{2}],1,1);
lmiterm([ Sen1{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen1{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen1{k} 2 2 X2{2}],1,1);
%************************************************
i=i+1;
k=k+1;
%**************** 4444 ****************
% Conditions for Known parts
Fir{k}=newlmi;
lmiterm([ Fir{k} 1 1 X1{i}],A{i},1+L{i},'s');
lmiterm([ Fir{k} 1 1 X1{i}],LMD(i,4),1);
lmiterm([ Fir{k} 1 2 -Z{i}],C{i}',1+L{i});
lmiterm([ Fir{k} 1 3 X1{i}],1,B{i});
lmiterm([ Fir{k} 1 4 0],H{i}');
lmiterm([ Fir{k} 2 2 Y{i}],1,1+L{i},'s');
lmiterm([ Fir{k} 2 2 X2{i}],LMD(i,4),1);
lmiterm([ Fir{k} 2 3 Z{i}],1,D{i});
lmiterm([-Fir{k} 2 4 -W{i}],1,1);
lmiterm([-Fir{k} 3 3 r_square],1,1);
lmiterm([-Fir{k} 4 4 0],1);
% conditions for unknown parts
Sen{k}=newlmi;
lmiterm([ Sen{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen{k} 1 1 X1{1}],1,1);
lmiterm([ Sen{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen{k} 2 2 X2{1}],1,1);
Sen1{k}=newlmi;
lmiterm([ Sen1{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen1{k} 1 1 X1{2}],1,1);
lmiterm([ Sen1{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen1{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen1{k} 2 2 X2{2}],1,1);
Sen2{k}=newlmi;
lmiterm([ Sen2{k} 1 1 X1{i}],A{i},1,'s');
lmiterm([ Sen2{k} 1 1 X1{3}],1,1);
lmiterm([ Sen2{k} 1 2 -Z{i}],C{i}',1);
lmiterm([ Sen2{k} 2 2 Y{i}],1,1,'s');
lmiterm([ Sen2{k} 2 2 X2{3}],1,1);
%*******************************************
lmisys=getlmis;
[tmin,xfeas]=feasp(lmisys);
n=decnbr(lmisys);
c=zeros(n,1);
for i=1:n
[RRi]=defcx(lmisys,i,r_square);
c(i)=RRi;
end
[copt,RRopt]=mincx(lmisys,c);
RR=dec2mat(lmisys,RRopt,r_square);
RRR=sqrt(RR)
for i=1:4
Xx1{i}=dec2mat(lmisys,RRopt,X1{i});
Xx2{i}=dec2mat(lmisys,RRopt,X2{i});
Yy{i}=dec2mat(lmisys,RRopt,Y{i});
Zz{i}=dec2mat(lmisys,RRopt,Z{i});
Ww{i}=dec2mat(lmisys,RRopt,W{i});
AF{i}=inv(Xx2{i})*Yy{i};
BF{i}=inv(Xx2{i})*Zz{i};
CF{i}=Ww{i};
end
AF{1}
AF{2}
AF{3}
AF{4}
BF{1}
BF{2}
BF{3}
BF{4}
CF{1}
CF{2}
CF{3}
CF{4}
%Xx2{1}
%Xx2{2}
%Xx2{3}
%Xx2{4}
%Xx1{1}
%Xx1{2}
%Xx1{3}
%Xx1{4}
%Zz{1}
%Yy{1}
%Ww{1}
save('five_I.mat');
总提示这个错误。
Result: infeasibility
The LMI constraints were found INFEASIBLE
Error using dec2mat (line 26)
DECVARS must be a vector of length 57
Error in five_I (line 188)
RR=dec2mat(lmisys,RRopt,r_square);
|