%%Problem

maximize a1*log2(1+b1*sinr_r)+a2*log2(1+b2*sinr_t)

s.t. p<=10

a1+a2=1

%% code

load(‘goodh.mat’,‘H1’,‘H2’);

noise=-170+10.*log10(180.*1e3);

sigma =10.^((noise)/10);

sinr_r=(abs(H1))^2/sigma;

sinr_t=(abs(H2))^2/sigma;

%%

cvx_begin

variable a1(1)

variable a2(1)

%variable b1

%variable b2

variable p(1)

b1=prod_inv([a1 p]);

b2=prod_inv([a2 p]);

y1=b1.*sinr_r;

y2=b2.*sinr_t;

rate_r=-rel_entr(a1,a1+y1);

rate_t=-rel_entr(a2,a2+y2);

rate=rate_r+rate_t;

maximize(rate)

subject to

p<=10;

a1+a2==1;

cvx_end

%% wrong

pa_good

CVX Warning:

Models involving “rel_entr” or other functions in the log, exp, and entropy

family are solved using an experimental successive approximation method.

This method is slower and less reliable than the method CVX employs for

other models. Please see the section of the user’s guide entitled

The successive approximation method

for more details about the approach, and for instructions on how to

suppress this warning message in the future.

错误使用 cvx/rel_entr (line 71)

Disciplined convex programming error:

Illegal operation: rel_entr( {real affine}, {convex} ).

出错 pa_good (line 21)

rate_r=-rel_entr(a1,a1+y1);