Why x*log(x) subject to 0< x <1 cannot be optimized? Answer: Use -entr(x)

I just want to have a try,my code like this :

cvx_begin
variables x
minimize(x*log2(x))
subject to
0<x<1
cvx_end

but it’s error. error code looks like this:

Disciplined convex programming error:
Invalid operation: {real affine} * {concave}

actually this object is convex and we can easily get its answer.

Use -entr(x) for x*log(x)… Divide by log(2) if you want log2(x).

You should read the CVX User’s Guide. entr is listed as a CVX function, and its definition and convexity information provided.

1 Like

thank you for your answer