Why this optimization problem is infeasible


(eliiiiiiiiiiiiiiiii) #1

Hi ,
I have a optimization problem as follow …why it is infeasible ?
I cheek it many times to fine problem …I think maybe its of objective…

please look at it and if you understand it please help me …

% In the name of God
%%part 2
clc
clear all
close all
%%
A = [-2 0.1 0.6;3 2 0.9;0 -0.5 0];
B = [-1;0.2;-0.1];
C = [-1 0 2];
Ad = [0.04 0.02 0;0.02 0.16 0.04;0.2 0.06 0.2];

n = size(A,1);
[n,m] = size(B);
[q,n] = size(C);
sys = ss(A,B,C,0,.1)
pzmap(sys)
%parameter of delay-Time varying
% k = 0:100
% TauSC = 0.2*sin(k);
% TauCA = 0.4*sin(k);
% d = 0.1*cos(k);
tau1 = -0.2;
tau2 = 0.2;
tau3 = -0.4;
tau4 = 0.4;
d1 =-0.1;
d2 =0.1;
Dbar = (d2-d1+1)
TCbar = (tau4-tau3+1)
TSbar = (tau2-tau1+1)
TCSbar = (tau4+tau2-tau3-tau1+1)
%parameter of Network
mu1 = 0.8; delta1 =0.4;
mu2 = 0.9; delta2 =0.5;
delta = [delta1^2 0; 0 delta2^2]
mu = [mu1 0;0 mu2]
%%

%First Step :
Y0 = eye(n)
X0 = eye(n)
for k=0:20
    %step 2=
    if  mod(k,2) == 0 %number is even
        cvx_begin sdp
        variable X1(n,n) symmetric;
        variable X2(n,n) symmetric;
        variable X3(n,n) symmetric;
        variable X4(n,n) symmetric;
        variable Q(n,n)  symmetric;
        variable T(n,n)  symmetric;
        variable W(n,n)  symmetric;
        
        variable AT(n,n)
        variable BT(n,m)
        variable CT(q,n)
        variable DT(q,m)
        variable gamasq nonnegative;
        variable betasq nonnegative;
        
        Y =Y0
        X =X0
        %First condition
        omega1 =(-1+Dbar+TCbar+TSbar+TCSbar)*Y
        omega2 =(-1+Dbar+TCbar+TSbar+TCSbar)*eye(n)
        omega3 =omega2
        omega4 =-X+Dbar*X1+TCbar*X2+TSbar*X3+TCSbar*X4
        
%         minimize 1
%         
%         subject to
      (delta)*gamasq+(inv(mu)-eye(2))*betasq<eye(2)
        %%H infinite condition
        [-Y -eye(n) A*Y A Ad mu1*B*CT zeros(n) zeros(n) zeros(n) mu1*mu2*B*DT*C mu1*B zeros(n,1) mu1*mu2*B*DT zeros(n,1) zeros(n,1);
            -eye(n) -X AT X*A X*Ad mu1*X*B*CT zeros(n) mu2*BT*C*Y mu2*BT*C mu1*mu2*X*B*DT*C mu1*X*B mu2*BT mu1*mu2*X*B*DT zeros(n,1) zeros(n,1);
            (A*Y)' AT' omega1 omega2 zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            A' (X*A)' omega3 omega4 zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            Ad' (X*Ad)' zeros(n) zeros(n) -Q zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            (mu1*B*CT)' (mu1*X*B*CT)' zeros(n) zeros(n) zeros(n) -Y -eye(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -eye(n) -X2 zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) CT' zeros(n,1);
            zeros(n) (mu2*BT*C*Y)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -Y -eye(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) Y*C';
            zeros(n) (mu2*BT*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -eye(n) -X3 zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) C';
            (mu1*mu2*B*DT*C)' (mu1*mu2*X*B*DT*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -T zeros(n,1) zeros(n,1) zeros(n,1) C'*DT' zeros(n,1);
            mu1*B' (mu1*X*B)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) -gamasq*eye(1) zeros(1) zeros(1) eye(1) zeros(1);
            zeros(1,n) (mu2*BT)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1) eye(1) zeros(1) zeros(1) eye(1);
            (mu1*mu2*B*DT)' (mu1*mu2*X*B*DT)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1) zeros(1) eye(1) DT' zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) CT zeros(1,n) zeros(1,n) (C'*DT')' eye(1) zeros(1) DT -eye(1) zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) (Y*C')' C zeros(1,n) zeros(1) eye(1) zeros(1) zeros(1) eye(1)]<0
        %H2 condition
        [Y eye(n) A*Y A Ad mu1*B*CT zeros(n) zeros(n) zeros(n) mu1*mu2*B*DT*C zeros(n,1) zeros(n,1);
            eye(n) X AT X*A X*Ad mu1*X*B*CT zeros(n) mu2*BT*C*Y mu2*BT*C mu1*mu2*X*B*DT*C zeros(n,1) zeros(n,1);
            (A*Y)' AT' Y eye(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            A' (X*A)' eye(n) X zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            Ad' (X*Ad)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            (mu1*B*CT)' (mu1*X*B*CT)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) CT' zeros(n,1);
            zeros(n) (mu2*BT*C*Y)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) Y*C';
            zeros(n) (mu2*BT*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) C';
            (mu1*mu2*B*DT*C)' (mu1*mu2*X*B*DT*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n)  mu2*C'*DT' zeros(n,1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) CT zeros(1,n) zeros(1,n) (mu2*C'*DT')' eye(1) zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) (Y*C')' C zeros(1,n) zeros(1) eye(1)]>0
        
        
        M = [mu1*B' mu1*B'*X;zeros(1,n) mu2*BT';mu1*mu2*DT'*B' mu1*mu2*DT'*B'*X]
        N =[Y eye(n);eye(n) X]
       Z = [zeros(1) zeros(1);zeros(1) zeros(1);mu2*DT' zeros(1)]
        
        [W M Z;M' N zeros(6,2);Z' zeros(2,6) eye(2)]>0
        
        trace(W)<betasq
        %
        cvx_end
        AT0 = AT
        BT0 = BT
        CT0 = CT
        DT0 = DT
        gamasq0=gamasq
        betasq0=betasq
        pause
    else  %number is odd
        cvx_begin sdp
        variable X1(n,n) symmetric;
        variable X2(n,n) symmetric;
        variable X3(n,n) symmetric;
        variable X4(n,n) symmetric;
        variable Q(n,n) symmetric;
        variable T(n,n) symmetric;
        variable Y(n,n) symmetric;
        variable X(n,n) symmetric;
        omega1 =(-1+Dbar+TCbar+TSbar+TCSbar)*Y
        omega2 =(-1+Dbar+TCbar+TSbar+TCSbar)*eye(n)
        omega3 =omega2
        omega4 =-X+Dbar*X1+TCbar*X2+TSbar*X3+TCSbar*X4
        
        
        minimize 1
        
        subject to
        delta*gamasq0+(inv(mu)-eye(2))*betasq0<eye(2)
        %H infinite condition
        LMI1 = [-Y -eye(n) A*Y A Ad mu1*B*CT0 zeros(n) zeros(n) zeros(n) mu1*mu2*B*DT0*C mu1*B zeros(n,1) mu1*mu2*B*DT0 zeros(n,1) zeros(n,1);
            -eye(n) -X AT0 X*A X*Ad mu1*X*B*CT0 zeros(n) mu2*BT0*C*Y mu2*BT0*C mu1*mu2*X*B*DT0*C mu1*X*B mu2*BT0 mu1*mu2*X*B*DT0 zeros(n,1) zeros(n,1);
            (A*Y)' AT0' omega1 omega2 zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            A' (X*A)' omega3 omega4 zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            Ad' (X*Ad)' zeros(n) zeros(n) -Q zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            (mu1*B*CT0)' (mu1*X*B*CT0)' zeros(n) zeros(n) zeros(n) -Y -eye(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1);
            zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -eye(n) -X2 zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) CT0' zeros(n,1);
            zeros(n) (mu2*BT0*C*Y)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -Y -eye(n) zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) Y*C';
            zeros(n) (mu2*BT0*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -eye(n) -X3 zeros(n) zeros(n,1) zeros(n,1) zeros(n,1) zeros(n,1) C';
            (mu1*mu2*B*DT0*C)' (mu1*mu2*X*B*DT0*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) -T zeros(n,1) zeros(n,1) zeros(n,1) C'*DT0' zeros(n,1);
            mu1*B' (mu1*X*B)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) -gamasq*eye(1) zeros(1) zeros(1) eye(1) zeros(1);
            zeros(1,n) (mu2*BT0)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1) eye(1) zeros(1) zeros(1) eye(1);
            (mu1*mu2*B*DT0)' (mu1*mu2*X*B*DT0)' zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1) zeros(1) eye(1) DT0' zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) CT0 zeros(1,n) zeros(1,n) (C'*DT0')' eye(1) zeros(1) DT0 -eye(1) zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) (Y*C')' C zeros(1,n) zeros(1) eye(1) zeros(1) zeros(1) eye(1)]
        %H2 condition
        [Y eye(n) A*Y A Ad mu1*B*CT0 zeros(n) zeros(n) zeros(n) mu1*mu2*B*DT0*C zeros(n,1) zeros(n,1);
            eye(n) X AT0 X*A X*Ad mu1*X*B*CT0 zeros(n) mu2*BT0*C*Y mu2*BT0*C mu1*mu2*X*B*DT0*C zeros(n,1) zeros(n,1);
            (A*Y)' AT0' Y eye(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            A' (X*A)' eye(n) X zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            Ad' (X*Ad)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            (mu1*B*CT0)' (mu1*X*B*CT0)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) zeros(n,1);
            zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) CT0' zeros(n,1);
            zeros(n) (mu2*BT0*C*Y)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) Y*C';
            zeros(n) (mu2*BT0*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n,1) C';
            (mu1*mu2*B*DT0*C)' (mu1*mu2*X*B*DT0*C)' zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n) zeros(n)  mu2*C'*DT0' zeros(n,1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) CT0 zeros(1,n) zeros(1,n) (mu2*C'*DT0')' eye(1) zeros(1);
            zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) zeros(1,n) (Y*C')' C zeros(1,n) zeros(1) eye(1)]>0
        
        M = [mu1*B' mu1*B'*X;zeros(1,n) mu2*BT0';mu1*mu2*DT0'*B' mu1*mu2*DT0'*B'*X]
        N = [Y eye(n);eye(n) X]
        Z = [zeros(1) zeros(1);zeros(1) zeros(1);mu2*DT0' zeros(1)]
        
        [W M Z;M' N zeros(6,2);Z' zeros(2,6) eye(2)]>0
        
        trace(W)<betasq
        
        cvx_end
        X0=X
        Y0=Y
    end
end
K = ss(AT0,BT0,CT0,DT0,0.1)
pzmap(K)

thank you


(Mark L. Stone) #2
sys = ss(A,B,C,0,.1)
pzmap(sys)

are unexecutable with what you have provided, but are not used anywhere, so I deleted them.

I then ran the program for k = 0. Not counting the nonnegative specifications in variable declarations, there are 5 constraints for the program branch) which is called for k = 0. The problem is infeasible if the H infinite condition is the only constraint. The problem is infeasible if the H2 infinite condition is the only constraint. The problem is feasible if both the H infinite condition constraint and the H2 infinite condition constraint are deleted.

If H2 infinite constraint is deleted, then changing RHS of H infinite condition constraint to t*eye(35), where t >= 7.50925 results in a feasible program, i.e., that’s how far away it is from being feasible.

If H infinite constraint is deleted, then adding t*eye(32) to LHS of H2 infinite condition constraint where t >= 4.21936 results in a feasible program, i.e., that’;s how far away it is from being feasible.

Adding t1*eye(35) to RHS of H infinite condition and t2*eye(32) to LHS of H2 infinite condition, where t1 >= 7.614 and t2 >= 4.5284 (obtained by minimizing t1+t2) makes the problem with all constraints feasible.

So obviously you need to look into why those 2 LMI constraints are infeasible. I showed how far they are from being feasible, individually and together, but not “why” they are infeasible. Also, you should pay attention to CVX’s warning to not use strict inequalities.