I am trying to perform a division operation of a numerator (5x4 real affine expression) by a denominator (scalar real affine expression). One of the DCP rules is that an affine cannot be divided by another another. Hence, I have tried to convexify the expressions using logarithm. This produces a {convex} - {concave} expression that CVX is rejecting and flagging as error. Please is there another way I can make it acceptable to CVX. Here are my codes.
% Operation that I want to perform sinr = log(numer ./ denom)
% numer is a 5x4 real affine expression
%denom is a scalar real affine expression
sinr = 0;
for t = 1:size(numer,1)
for v = 1:size(numer,2)
sinr = sinr + log(numer(t,v)) + (-log(denom));
end
end
obj = B_RB .* sinr;
maximize(obj)
subject to
0<=pf<=(10^(23/10))/1000;
cvx_end
Your attempt at convexification is not convexifying.
log(x/y) (for x and y being scalars) is an indefinite form (neither convex nor concave) with respect to x and y. If this is the problem you need to solve, you will need to use a tool which can handle non-convex problems.
Thanks for your response sir, there are more or less the same problem and I have attempted to follow the DCP rules but still not getting it accepteable to CVX. I came across this and tried using the steps to convexify the problem I’m solving. However, if you were to express the last equation on CVX, how would you write the log_sum_exp part which is a convex expression?
When used in a CVX model, log_sum_exp(X) causes CVX's successive
approximation method to be invoked, producing results exact to within
the tolerance of the solver. This is in contrast to LOGSUMEXP_SDP,
which uses a single SDP-representable global approximation.
If X is a matrix, LOGSUMEXP_SDP(X) will perform its computations
along each column of X. If X is an N-D array, LOGSUMEXP_SDP(X)
will perform its computations along the first dimension of size
other than 1. LOGSUMEXP_SDP(X,DIM) will perform its computations
along dimension DIM.
Disciplined convex programming information:
log_sum_exp(X) is convex and nondecreasing in X; therefore, X
must be convex (or affine).
You want to define a new CVX variable, G_bar, which will be log(G). You only tell CVX about G_bar, and never tell it about G, and therefore do not use log(G) in CVX. Use G_bar, not log(G) in CVX.
@Michael_Tarerefa, I need to suggest that you stop trying to use CVX. You really haven’t internalized the necessary approach to using it properly, and I promise you that it will give you nothing but frustration if you continue on this path.
CVX is not a tool for solving any model you want to throw at it. It only solves models that are convex, and in fact, it can’t even solve all convex models! If you don’t respect what is said in the FAQ, you are guaranteed to fail.
Dear sir @mcg , the capacity maximization problem I’m trying to solve is a well known convex optimization problem in wireless comunication. I’m making genuine attempts and strongly believe that I’m not far from getting it right. Thanks for the criticism though.
Many problems that are claimed to be convex in papers are not in fact written in their solvable form in those same papers. I wish authors would be required to be more explicit in showing exactly how they solved problems they claim are convex. Heck, if they claim to use CVX they should include the model code or make it readily available, but they often do not.
But I can’t blame authors for the failure of CVX users to read and obey the FAQ. Have you proven it is convex yet? It is not enough to trust other papers. You must prove it is convex, yourself. And more importantly, you must be able to do it solely by using only the rules laid out in the DCP ruleset, using the functions found in the supported function list.
The very fact that you asked “How to divide real affine matrix by real affine scalar” tells me you haven’t followed those instructions. You would not have asked this if you had, because the DCP rules clearly do not allow this, and the FAQ explains why. The same goes for your attempt to subtract one concave logarithm from another.
Yes, I agree that most papers claiming to solve convex problems are infact non-convex. I have seen quite a few and wished that authors can make a practice of publishing of their codes along with the papers. Thanks sir.
Thanks to our conversation I’ve added a new section to the FAQ to talk about “proof by citation”
I know it sounds harsh, here and in the FAQ, to tell people not to use our software. But it really is frustrating, as you surely know, to keep running into these DCP errors.
Many thanks @mcg and @Mark_L_Stone for your patience and understanding. I have been able to resolve the problem using CVX. This thread of conversation challenged me and open my eyes to the workings of CVX. Thanks once again.
Study sections 4.2.5 and 4.3.2 of Boyd and Vandenberghe “Convex Optimization” https://web.stanford.edu/~boyd/cvxbook/ so that you can understand this solution.