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 :

variables x
subject to

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