Cannot perform the operation: {concave} ./ {real affine}

(Shahrukh Khan Kasi) #1

I want to solve a simple convex problem that minimizes the power of transmitting devices. I have a supposed that there are 10 devices each communicating with another device. But, when I run the program it gives me this error:

Error using .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {concave} ./ {real affine}
Error in ./ (line 19)
z = times( x, y, ‘./’ );
Error in testcode4 (line 36)
Rate(i,j) = W*(log(1+(p(i)((distance(i,j)).^(-pathloss)))./log(2))./((NSDW)+I_D(i,j)));

How can I convert the denominator term in the Rate expression, so that the Rate expression can be solved?

distance = rand(10,10);
Rate_min = ones(10,10);
Power_total = 10;
W = 1;
NSD = 1;
pathloss = 1;

variable p(10,1) nonnegative
minimize norm(p)
subject to
for i = 1:10 
    for j = 1:10
        I_D(i,j) = (p(j))*((distance(i,j)).^(-pathloss));
        Rate(i,j) = W*(log(1+(p(i)*((distance(i,j)).^(-pathloss)))./log(2))./((NSD*W)+I_D(i,j)));
sum(p) <= Power_total;

(Mark L. Stone) #2

As per one of the suggestions I gave you at Conversion to double from cvx is not possible , remove all instances of Rate and instead use
log(1+(p(i)*((distance(i,j)).^(-pathloss)))) >= Rate_min(i,j)
except that now that you have a denominator term on the left-hand side, move it to the right-hand side (as a multiplicative term), where it will be affine, and therefore accepted by CVX (you can put log(2) where you want).

Or you can change Rate(i,j) to not include the denominator, and proceed in the obvious manner based on the above to include the denominator term as a multiplicative term in the right-hand side of the inequality.

(Shahrukh Khan Kasi) #3

Thank you so very much.