Hi,*

I have checked that the problem is sure to be concave. For some parameters, it works well. However, when I try to change some parameters to another, it displays like the error. Could you please help me for this?

*Disciplined convex programming error:*

Cannot perform the operation: {invalid} .* {real affine}*

**or**

*Disciplined convex programming error:*

*Cannot perform the operation: {negative constant} .* {real affine}*

ps: i have read the DCP ruleset and know it well. This is also I use “rel_entr” function in the code. But I just can not solve the above. Thanks.

```
for i=1:5
cvx_begin
variable p0(n)
variable b(i)
variable x(i)
variable w(i)
variable y(i)
maximize ( ( sum( b0.*log(1+ p0.*g0./b0) ) - sum( rel_entr(b,x) ) ) ...
- u*( sum( p0 )/xi + sum( (x-b)./g )/xi + sum( (y-w)./h )/xi + p_c ) )
subject to
zeros(n,1) <= p0;
zeros(i,1) <= b;
zeros(i,1) <= ( x - b )./g;
zeros(i,1) <= w;
zeros(i,1) <= ( y-w )./h;
sum( p0 ) + sum( (x-b)./g ) + sum( (y-w)./h ) <= P_max;
b + w <= W_max.*index;
-rel_entr(w,y) >= mu_rmin.*index;
cvx_end
num_dink=num_dink+1;
if cvx_optval<=tolerance
break;
else
u = ( sum( b0.*log(1+ p0.*g0./b0) ) - sum( rel_entr(b,x) ) )...
/( sum( p0 )/xi + sum( (x-b)./g )/xi + sum( (y-w)./h )/xi + p_c );
end
```

disp(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

disp(['try to selecte MU ', num2str(i)])

disp(['the previous SC system EE: ', num2str(ee_sc_temp)])

disp([‘the updated SC system EE: ‘, num2str(ee_sc_update)])

disp(’%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%’)

Error using cvx/times (line 173)

Disciplined convex programming error:

Cannot perform the operation: {negative constant} .* {real affine}

Error in cvx/mtimes (line 36)

z = feval( oper, x, y );

Error in EE10_power_saving (line 176)

maximize ( ( sum( b0.*log(1+ p0.*g0./b0) ) - sum( rel_entr(b,x) ) ) …

*This is another display in the command window:*

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

try to selecte MU 1

the previous SC system EE: 2498634.153

the updated SC system EE: 2561509.6624

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

try to selecte MU 2

the previous SC system EE: 2561509.6624

the updated SC system EE: 2617537.04

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

try to selecte MU 3

the previous SC system EE: 2617537.04

the updated SC system EE: 2666679.5159

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

try to selecte MU 4

the previous SC system EE: 2666679.5159

the updated SC system EE: 2708451.445

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Error using cvx/times (line 173)

Disciplined convex programming error:

Cannot perform the operation: {invalid} .* {real affine}

Error in cvx/mtimes (line 36)

z = feval( oper, x, y );

Error in EE10_power_saving (line 176)

maximize ( ( sum( b0.*log(1+ p0.*g0./b0) ) - sum( rel_entr(b,x) ) ) …

**As we can see that in “try to selecte MU 1” “try to selecte MU 2” “try to selecte MU 3” “try to selecte MU 4”, the code works well, but shows a error for “try to selecte MU 5”**