# How to write this optimization problem in CVX?

Hey Guys,
I would like to use cvx to solve the following optimization problem, but don’t know how to correctly write it up on CVX form. Any help would be greatly appreciated.

Where R_{unl,i} = \sum_{k} \sum_{m} R_{unl,i}^{(k,m)}.
SINR is not a function of c and the dimensions of c are (I,J, K, M).

1 Like

I haven’t sorted through the mess of what all your symbols are, but try making use of the construct x*log2(1+y/x) = -rel_entr(x,x+y)/log(2)

1 Like

I made use of the construct you mentioned and write the following code. I have difficulty in implementing the constraints (second constraint above) and don’t know if I use the CVX correctly or not. Could you please kindly take a look at the following code and let me know what kind of modification I need to make? Thanks in advance.

[tmp1,tmp2,y1,y2] = ParametersNeededInCVX(.....);
cvx_begin
cvx_quiet(true); % This suppresses screen output from the solver
variable c(max(nr_L(:)), numel(nr_L), numel(nbrOfSubCarriers), max(nbrOfSubCarriers(:))) real;
OBJ = 0;
for k = 1 : numel(nbrOfSubCarriers)
for m = 1: nbrOfSubCarriers(k)
for eNodeB = 1 : numel(nr_L)
for UE = 1 : nr_L(eNodeB)
OBJ = OBJ - tmp1(eNodeB,k,m)*rel_entr(c(UE, eNodeB, k, m),c(UE, eNodeB, k, m)+y1(UE, eNodeB, k, m))/log(2) ...
- tmp2(eNodeB,k,m)*rel_entr(c(UE, eNodeB, k, m),c(UE, eNodeB, k, m)+y2(UE, eNodeB, k, m))/log(2);
end
end
end
end
maximize(OBJ)

subject to
0 <= c <= 1;
Const = 0;
for eNodeB = 1 : numel(nr_L)
for UE = 1 : nr_L(eNodeB)
Const = Const + c(UE, eNodeB, k, m) <= 1;
end
end

cvx_end

As I wrote before, the notation is a mess,. and i don’t know the mapping between the image and your code.

Nevertheless, I’ll state the following. You have the right idea to take the expression for R (the last line of the image in your post) and express that in terms of rel_entr where R appears in the objective function (or anywhere else, such as in your other question). In terms of my construct above, x*log2(1+y/x), the image’s \gamma B is the x, and \chi SINR is the y.where I have not shown the sub and superscripts. As far as I can tell, the other constraints are affine (linear), so can be entered straghtforwardly just as they appear in the image. You can simplify things a bit using sum(sum(…)) in one of the constraints, but using for loops is not incorrect.

2 Likes

I have got two questions for you and I appreciate that if you could kindly answer them.
1- It seems my understanding was completely wrong. I considered tmp1 = γB and y1 =X SINR/ γB, and x = c as the variable of interest. I will modify my code according to what you mentioned. My question is, there is no need to enter the variable c here? I got confused.

2- Second constraint should be satisfied for each k and m. How should I involve these k and m in the following code
Const = 0;
for eNodeB = 1 : numel(nr_L)
for UE = 1 : nr_L(eNodeB)
Const = Const + c(UE, eNodeB, k, m) <= 1;
end
end

You need to declare c as a variable. Whoops, Not including c in what should be \gamma c B\$ for x was a typo by me.

Something like the following (fill in the k and m for ranges)

for k = ...
for m = ...
sum(sum(c(:,:,k,m),1),2) <= 1
end
end


Again, I have no idea what your indices are, why you have two different tmp*rel_entr terms in the objective - I’m not saying ti’s not correct, but I’ll let you figure out what all your summations are over, the indices, etc. I am leaving you to check all that.

1 Like

Sorry, I edited my previous post before seeing your most recent post. I didn’t include c because I made a typo. I meant to include it.

I also just corrected a typo with missing k and m in my sum(sum …))

Got you! Thank you very much again!