Convex optimization Question

Hi,

I wrote the code of an optimization problem but i face an error on matrix dimension.
I checked all elements dimension but i couldn’t find which element has not correct dimension.

can anyone help me to solve the my problem.???
Thank you.
error is on matrix dimension of H_infinite condition
Code :

A =[1.1 1;0 1.2];
B = [0;1];
C = [1 0];
Bmu1 = B*0.8;Bmu2 = B*0.9;
delta1 = 0.4;delta2 = 0.5;
mu1 = 0.8;
mu2 = 0.9;
n = size(A,1);
[n1,m] = size(B);
[n2,m1] = size(C);

cvx_begin sdp
variable X(n,n) symmetric;
variable Y(n,n) symmetric;
variable N(n,n) ;
variable Q;
variable AT(n,n);
variable BT(n,m) ;
variable CT(n2,n);
variable DT(n2,m);
variable gama1;
variable gama2;
variable gama3;
variable gama4;

omega1 = A+Bmu1*DT*C;
omega2 = A*X+Bmu1*CT;
omega3 = Y*A+BT*C;

% condition LMI % H-infinite
(delta1^2*gama1+(inv(mu1)-1)*gama2)<1
(delta2^2*gama3+(inv(mu2)-1)*gama4)<1

% H2 condition
U=[Bmu1' Bmu1'*Y;zeros(1,n) Bmu2'*N']
S=[Bmu1 (Bmu1'*Y)';zeros(n,1) (Bmu2'*N')']
L =[X eye(n);eye(n) Y]
[Q*eye(n) U;S L]
% H - infinite condition 
[-X -eye(n) omega2 omega1 Bmu1 zeros(n,1) zeros(n,1) zeros(n,1);
-eye(n) -Y AT omega3 (Y*Bmu1) (N'*Bmu1) zeros(n,1) zeros(n,1);
omega2' AT' -X -eye(n) zeros(n,1) zeros(n,1) CT' X*C';
omega1' omega3' -eye(n) -Y zeros(n,1) zeros(n,1) (DT*C)' C';
Bmu1' (Y*Bmu1)' zeros(1,n) zeros(1,n) -gama1*eye(1,1) zeros(1,1) eye(1,1) zeros(1,1);
zeros(1,n) (N'*Bmu1)' zeros(1,n) zeros(1,n) zeros(1,1) -gama3*eye(1,1) zeros(1,1) eye(1,1);
zeros(1,n) zeros(1,n) CT (DT*C) eye(1,1) zeros(1,1) -eye(1,1) zeros(1,1);
zeros(1,n) zeros(1,n) (X*C) C zeros(1,1) eye(1,1) zeros(1,1) -eye(1,1)]<0
trace(Q)<diag([gama2 gama4])
cvx_end

The error is due to
(X*C)
in the last row of the matrix. X is n by n. (in this case, 2 by 2). C is 1 by 2. So X*C is non-conformal.

Also, per CVX’s warning messages,

Warning: The use of strict inequalities in CVX is strongly discouraged,
because solvers treat them as non-strict inequalities. Please
consider using “<=” instead.

Edit: Perhaps you meant to enter (C*X) , which would allow the LMI to be accepted by CVX. But you will still encounter an error with trace(Q)<diag([gama2 gama4]) , which makes no sense, because the left-hand side is a scalar, and the right-hand side is a 2 by 2 matrix. Given that Q is a scalar variable ,trace(Q) is the same as Q. I’ll let you determine what constraint(s) you are really trying to impose with that.

1 Like

thank you .
It was very helpful.
I solved that problem but i encounter with another one. when i run the program it doesn’t give answer.
I mean X and Y and N are NaN.
%%
A =[1.1 1;0 1.2];
B = [0;1];
C = [1 0];
Bmu1 = B0.8;Bmu2 = B0.9;
delta1 = 0.4;delta2 = 0.5;
mu1 = 0.8;
mu2 = 0.9;
n = size(A,1);
[n1,m] = size(B);
[n2,m1] = size©;

cvx_begin sdp
variable X(n,n) symmetric;
variable Y(n,n) symmetric;
variable N(n,n) ;
variable Q(n,n);
variable AT(n,n);
variable BT(n,m) ;
variable CT(n2,n);
variable DT(n2,m);
variable gama1;
variable gama2;
variable gama3;
variable gama4;

omega1 = A+Bmu1DTC;
omega2 = AX+Bmu1CT;
omega3 = YA+BTC;

% condition LMI % H-infinite
(delta1^2*gama1+(inv(mu1)-1)gama2)<1
(delta2^2
gama3+(inv(mu2)-1)*gama4)<1

% H2 condition
U=[Bmu1’ Bmu1’Y;zeros(1,n) Bmu2’N’]
S=[Bmu1 (Bmu1’Y)’;zeros(n,1) (Bmu2’N’)’]
L =[X eye(n);eye(n) Y]
[Q U;S L]>=0
% H - infinite condition
[-X -eye(n) omega2 omega1 Bmu1 zeros(n,1) zeros(n,1) zeros(n,1);
-eye(n) -Y AT omega3 (Y
Bmu1) (N’Bmu1) zeros(n,1) zeros(n,1);
omega2’ AT’ -X -eye(n) zeros(n,1) zeros(n,1) CT’ X
C’;
omega1’ omega3’ -eye(n) -Y zeros(n,1) zeros(n,1) (DT
C)’ C’;
Bmu1’ (Y
Bmu1)’ zeros(1,n) zeros(1,n) -gama1
eye(1,1) zeros(1,1) eye(1,1) zeros(1,1);
zeros(1,n) (N’Bmu1)’ zeros(1,n) zeros(1,n) zeros(1,1) -gama3eye(1,1) zeros(1,1) eye(1,1);
zeros(1,n) zeros(1,n) CT (DTC) eye(1,1) zeros(1,1) -eye(1,1) zeros(1,1);
zeros(1,n) zeros(1,n) (C
X) C zeros(1,1) eye(1,1) zeros(1,1) -eye(1,1)]<=0

trace(Q)<trace(diag([gama2 gama4]))
cvx_end

M = ((eye(n) - X*Y)*inv(N)')
% controller parameter 
DK = DT
CK =(CT-((DT*C)*X))*(inv(M))'
Bmu2K = inv(N)'*(BT -Y*Bmu1*DK)
AK = (inv(N)'*AT*inv(M1)')-(inv(N)'*Y*Bmu1*CK)-(Bmu2*C*X*inv(M)')-(inv(N)'*Y*(A+Bmu1*DK*C)*X*inv(M)')
sys = ss(AK,BK,CK,DK,0.1)
K =tf(sys)

pause

The variables are NaN because CVX/solver determined the problem to be infeasible. That is the result I got with both sdpt3 and sedumi. You should always look at (or have your program check) the status reported by CVX, which in this case is Infeasible.

Note that your original program, with (X*C) changed to (C*X) and deletion of trace(Q)<diag([gama2 gama4]) was feasible.