Problem about rel_entr

I still have no idea what you’re trying to do. W was declared a scalar variable.

As I wrote before, the objective function must evaluate to a real scalar.

What if the objective function were allowed to evaluate to a complex number? Which is a bigger (better) objective value, 2 + i or 3 - i? Of course that doesn’t make sense. You need to formulate an optimization problem whose objective function evaluates to a real scalar. If you wish to use CVX, it must be a convex optimization problem following CVX’s rules.

Dear expert, Thanks for your time. I want to consult a question.
Status: Infeasible
Optimal value (cvx_optval): -Inf

错误使用 + (line 83)
Disciplined convex programming error:
Illegal operation: {invalid} + {real affine}

出错 main (line 155)
real(tao1+tao2)<=real(0.8P1trace(Fa1*W))

What’s the problem with this? Can you help me see.

This looks like one CVX problem was infeasible. Therefore, the CVX variable values had value “NaN”. You perhaps then used variable values from this CVX problem as input data into a new CVX problem. CVX then issued an error because NaN values were used in a CVX expression.

Dear expert, Thanks for your time. I want to consult a question.
错误使用 .* (line 262)
Disciplined convex programming error:
Invalid quadratic form(s): not a square.

出错 * (line 36)
z = feval( oper, x, y );

出错 Untitled (line 122)
real(tao1+tao2)<=real(0.8P1t1trace(V1Fa1));
What’s the problem with this? Can you help me see.

cvx_begin quiet
            variable t1
            variable t2
            variable tao1
            variable tao2
            variable V1(length(V1),length(V1)) 
             maximize(-rel_entr(t2,real(t2+lo1*tao1))/log(2)
            subject to
            real(tao1+tao2)<=real(0.8*P1*t1*trace(V1*Fa1));
            t1+t2<1;
            tao1>=0;
            tao2>=0;
            V1(logical(eye(size(V1))))==1;
            cvx_end

There are product terms of the variables t and v1m which is in violation of CVX’s rules. Have you proven that constraint is convex?

image
Dear expert,
Thanks for your time. I want to consult a question. How to solve this problem with CVX?

Nonlinear equality constraints are non-convex. Did you read the link in my previous post?

I can convert it into the following optimization problem, so that it can be solved directly with CVX

image

I have no idea what you’ve done, but will take your word on the conversion.

Dear expert, Thanks for your time. I don’t know where the problem is, how to rewrite it.

错误使用 .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {positive constant} ./ {real affine}

出错 ./ (line 19)
z = times( x, y, ‘./’ );

出错 * (line 36)
z = feval( oper, x, y );

出错 / (line 15)
z = mtimes( x, y, ‘rdivide’ );

出错 shishitimeopwer (line 257)
Cmk=(rmin(itr)noisepow_Bob)/real(p2)-real(trace(GeGe’*V2g1));Cmk2=(rmin(itr)noisepow_Bob)/real(p2)-real(trace(Ge2Ge2’*V2g1));

Please show the entire code. I don’t even know what the CVX variables or expressions are. But before you do so, please ensure that your optimization problem is convex, per Why isn't CVX accepting my model? READ THIS FIRST! .

Depending on the context, it might be possible to write {positive constant} ./ {real affine} as {positive constant}*inv_pos(real affine)


错误使用 .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {positive constant} ./ {convex}

出错 ./ (line 19)
z = times( x, y, ‘./’ );

出错 * (line 36)
z = feval( oper, x, y );

出错 / (line 15)
z = mtimes( x, y, ‘rdivide’ );

出错 U111notime (line 267)
Cmk=(rmin(itr)noisepow_Bob)/inv_pos(p2)-trace(GeGe’*V2g1);Cmk2=(rmin(itr)noisepow_Bob)/inv_pos(p2)-trace(Ge2Ge2’*V2g1);

I believe you want *inv_pos not /inv_pos (in 2 statements) I don’t know whether your code has any other issues.

In the future, please copy and paste your code as text, using Preformatted text icon, rather than posting an image of the code. And don’t use quietuntil you are sure everything is working correctly.

Dear expert, Thanks for your time. This is my optimization constraint

If min(itr)*noisepow_Bob > 0, as it appears to be, then Cmk and Cmk2 are convex, so the >= 0 constraints with those on the LHS are going in the wrong direction to be convex constraints, and CVX should reject those constraints…

Dear expert:rmin(itr)*noisepow_Bob > 0,Can’t use this constraint, how to fix it?

Dear expert:
This is my code:
cvx_begin sdp
cvx_quiet(true)
variable V2g1(length(V2g1),length(V2g1)) hermitian;
variable V2g2(length(V2g2),length(V2g2)) hermitian;
variables x y x2 y2;
s1 = (yitaP1real(trace(WFa1))-W0)/(noisepow_Bob);%W0=P3t2
s2 = W0/(noisepow_Bob);
lo1 = real(s1trace(V2g1Fa2g1));
lo2 = real(s2trace(V2g2Fa2g2));
R1=-rel_entr(t2,t2+real(lo1));%速率
R2=-rel_entr(t2,t2+real(lo2));%速率
sinr1_AP1=(trace(V2g1*Fa2g1)p2)/(noisepow_Bob);
sinr2_AP1=(trace(V2g1
Fa2g1)*p3)/(noisepow_Bob);

Ge=Fe2g1;
xita=ce;
LI=eye(Mtot/2);
Amk=(-p2)sqrtm(xita)V2g1sqrtm(xita);
Cmk=(rmin
noisepow_Bob)+real(trace(GeGe’V2g1(-p2)))
kkk=kron(sqrtm(xita)’,sqrtm(xita))vec(-p2V2g1);
kk=sqrt(2)sqrtm(xita)(-p2
LI)vec(V2g1Ge);
bbk=[kkk;kk];

maximize R1+R2
subject to
real(trace(Amk)-sqrt(-2.*log(Lo)).*x+log(Lo).y+Cmk)>=0;
norm(bbk,2)<=x;
y
LI+Amk==hermitian_semidefinite(Mtot/2);

       for n=1:1:length(V2g1)
                V2g1(n,n)==1;
         end
        V2g1 == hermitian_semidefinite(length(V2g1))
         for n=1:1:length(V2g2)
                V2g2(n,n)==1;
         end
         V2g2 == hermitian_semidefinite(length(V2g2))
         y>=0;

sinr2_AP1>=rmin;
sinr1_AP1>=rmin;
cvx_end
cvx_optval
This is my formula:


I don’t know where is the problem, please help me to find out how to solve it.

You have a big mess which seems to keep changing/. I don’t know what is what.

Please show us which constraint(s) are not accepted by CVX, and show us the proof that the constraints are convex.