rate_temp_ullok = -rel_entr(pu.*ylg+para.bandwidth.*(ones(user.num, 1)*band_u).*para.noise,pu.*ylg+para.bandwidth.*(ones(user.num, 1)*band_u)...
.*para.noise+pu([2 1],:).*ylg([2 1],:))...
.*(ones(user.num,1)*band_u).*inv_pos(pu.*ylg+para.bandwidth*(ones(user.num, 1)*band_u)*para.noise);
My variable is band_u, my CVX is wrong, please help me,thanks.
错误使用 .* (line 173)
Disciplined convex programming error:
Cannot perform the operation: {concave} .* {real affine}
出错 opt_bandwidth (line 55)
rate_temp_ullok = -rel_entr(pu.ylg+para.bandwidth.(ones(user.num, 1)*band_u).*para.noise,pu.ylg+para.bandwidth.(ones(user.num,
1)*band_u)…
It is hard to decipher this unexecutable code. Do the arguments of rel_entr comply with the rules? The first argument must be affine, and the 2nd argument must be concave, The 2nd argument looks like it is affine*convex, because inv_pos is convex. So this violates the rules. Have you proven that rate_temp_ullok is concave?
help rel_entr
rel_entr Scalar relative entropy.
rel_entr(X,Y) returns an array of the same size as X+Y with the
relative entropy function applied to each element:
{ X.*LOG(X./Y) if X > 0 & Y > 0,
rel_entr(X,Y) = { 0 if X == 0 & Y >= 0,
{ +Inf otherwise.
X and Y must either be the same size, or one must be a scalar. If X and
Y are vectors, then SUM(rel_entr(X,Y)) returns their relative entropy.
If they are PDFs (that is, if X>=0, Y>=0, SUM(X)==1, SUM(Y)==1) then
this is equal to their Kullback-Liebler divergence SUM(KL_DIV(X,Y)).
-SUM(rel_entr(X,1)) returns the entropy of X.
Disciplined convex programming information:
rel_entr(X,Y) is convex in both X and Y, nonmonotonic in X, and
nonincreasing in Y. Thus when used in CVX expressions, X must be
real and affine and Y must be concave. The use of rel_entr(X,Y) in
an objective or constraint will effectively constrain both X and Y
to be nonnegative, hence there is no need to add additional
constraints X >= 0 or Y >= 0 to enforce this.
Thanks for your reply!!!
,Could you please tell me what’s the limitation of this X parameter in this picture?Can this X only be affine?
x must be affine. b must be concave. Note that affine is a special case of concave, so b can be `affine.