爱雪1314 发表于 2015-5-10 10:05

您好,我在仿真一个LMI,总提示dec2mat这个函数错误。

您好,我在仿真一个LMI,总提示dec2mat这个函数错误,我觉得是LMI没有可行解导致的。做的方向是部分未知转移概率的Markov跳跃系统H-inf滤波器的设计。这是程序,麻烦帮我看一下,谢谢了。
clear all
A{1}=;
A{2}=;
A{3}=;
A{4}=;
B{1}=;
B{2}=;
B{3}=;
B{4}=;
C{1}=;
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}=;
H{2}=H{1};
H{3}=H{1};
H{4}=H{1};
LMD=[-1.30.20.80.3;
      0.3 -0.90.30.3;
      0.60.6 -1.50.3;
      0.40.20.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,);
            X2{k}=lmivar(1,);
            Y{k}=lmivar(2,);   
            Z{k}=lmivar(2,);
            W{k}=lmivar(2,);      
end
r_square=lmivar(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;
=feasp(lmisys);
n=decnbr(lmisys);
c=zeros(n,1);
for i=1:n
    =defcx(lmisys,i,r_square);
    c(i)=RRi;
end
=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);

爱雪1314 发表于 2015-5-11 09:19

论坛里的MATLAB大神呢??

爱雪1314 发表于 2015-5-11 17:30

可行性问题解决了,又来个更棘手的。我现在再做连续系统的H—inf滤波器设计,之前运行的LMI不可行,调完系数之后运行结果是滤波器的增益Bf,和Cf结果是0矩阵,这是怎么回事呀?? p=1.5; A{1}=p*[-0.5 -0.5;1 -1]; A{2}=0.4*[-0.1 -0.33;1 -1.4]; A{3}=1.3*[-0.2 -0.1;1 -1.2]; A{4}=p*[-0.6 -0.23;1 -1.1]; 把A换成上面的矩阵就行了。

love2000 发表于 2016-7-4 22:05

爱雪1314 发表于 2015-5-11 17:30
**** 作者被禁止或删除 内容自动屏蔽 ****

楼主您好,请问您的问题解决了吗,我最近也遇到了类似的问题,可以讨论一下吗

vibmaster 发表于 2016-7-5 09:08

爱雪1314 发表于 2015-5-11 17:30
**** 作者被禁止或删除 内容自动屏蔽 ****

额那现在是解决了还是没解决啊
页: [1]
查看完整版本: 您好,我在仿真一个LMI,总提示dec2mat这个函数错误。