Solve unconstrained problem with cvx

Hello everyone,

I am trying to solve this problem in cvx: maximize log2(1+x), where is x is the optimization variable.

Can cvx solve it? if not what can be a workaround for it.?

log2(1+x) can be reformulated for CVX as log(1+x)/log(2) using the standard log change of base rule.

Without an upper bound on x, the problem is unbounded, and solvers might fail to even come to the conclusion that it is unbounded (which it is().

Thank you for the response. When I bound it above I get disciplined programming error: concave <= constant. Any ideas on this one?

Upper bound on x, not on log(1+x)/log(2)

cvx_begin
variable x
maximize(log(1+x)/log(2))
x <= 973`
cvx_end
1 Like

I see. One last question. Will the following still produce the same result:

cvx_begin
variable x
expression m
m = 3x
maximize(log(1+m)/log(2))
m <= 973`
cvx_end

There is a missing * in m = 3*x. Presuming that is there. the optimal objective would be the same, but optimal x will be 1/3 the value.

Understood. Thank you