here is the error constraint, how to rewirte this constrain in a proper form.

cvx_begin

variable delta(M,1)

subject to

for m=1:M

R2(m,k)=log(1+1.*pow_p((pow_p(delta(m,1),2)),-1))/log(2)>=0;

end

cvx_end

# Illegal operation: log( {convex} )

**mrlo**(mrlo) #1

Illegal operation: log( {convex} ) how to deal with this kind of operation, please give me a favor

**Mark_L_Stone**(Mark L. Stone) #2

`log(1+1.*pow_p((pow_p(delta(m,1),2)),-1))/log(2)`

doesn’t follow CVX’s DCP rules. But in any event, it s convex, and therefore constraining it to be >= 0 is a non-convex constraint.

If the log were removed, which makes the LHS a “legal” convex expression, constraining that to be >= 1 would still be a non-convex constraint.

**mrlo**(mrlo) #4

M=4;

K=10;

I=M+1;

cvx_begin

variables eta delta(M,1) xi(M,1)

expressions R1(M,K) R2(I,M) R3(M,K) R4(M,M)

maximize(eta)

subject to

%% first constraint

for m=1:M

for k=1:K

R1(m,k)=-(delta(m,1).^2+xi(m,1).^2)-delta(m,1)-xi(m,1);

end

sum(R1(m,:)) >= eta;

end

%% second constraint

for m=1:M

for i=1:I

R2(i,m)=-(square(delta(m,1))+square(xi(m,1)))-delta(m,1)-xi(m,1);

end

for k=1:K

R3(m,k)=log(pow_p((1+2*delta(m,1)+2.*xi(m,1)),-1))/log(2); % illegal operation here

end

for j=1:M

R4(m,j)=log(pow_p((1+2.*delta(m,1)+2.*xi(m,1)),-1))/log(2); % illegal operation here

end

sum(R2(:,m))>=sum(R3(m,:))+sum(R4(m,:));

end

cvx_end

**Mark_L_Stone**(Mark L. Stone) #5

You have multiple violations of CVX’s rules. If you ever got some version of R3 and R4 to be accepted, the final constraint would still violate CVVX’s rules. This model looks non-convex to me, although I have not completely ruled out that is may somehow net out to be convex.

If you don’t have a convex model, there is no hope of getting it accepted by CVX. Even if you do have a convex model, I;m not sure expressions such as R3 and R4 can be formulated in a way acceptable to CVX.

**mcg**(Michael C. Grant) #6

I must insist that you not repeatedly post about effectively the same issue. Indeed, I would suggest that CVX is not appropriate for the kind of models you are solving.