How to write 0 <= U <= exp(-X*) * (1 - (X - X*))

屏幕截图 2022-03-06 160710

That line you comment out is correct code, according to


" The latest version of CVX now allows you to chain inequalities together; e.g., l <= x <= u. (Previous versions did not allow chained inequalities.) "
If you are using CVX 2.2, that should be fine.

x*exp(x) and x*exp(-x) are both convex for x >= 0. You haven’t told us which of X and X* are CVX variables. In order for the constraint to be convex, the RHS has to be concave, which looks rather dubious.

As for chaining inequalities together, it is true that the CVX 2.2 Users’ Guide says

The latest version of CVX now allows you to chain inequalities together; e.g., l <= x <= u. (Previous versions did not allow chained inequalities.)

The CVX 1.22 Users’ Guide from August 2012 says

The latest versions of cvx now allow you to chain inequalities together; e.g., l <= x <= u.

So the CVX 2.2 Users’ Guide statement

Previous versions did not allow chained inequalities

is not true.

The issue for this question is not the chaining, but the convexity of the constraints.

Thank you ,the problem is solved.