CVX help!Disciplined convex programming error: Illegal operation: pow_p( {convex}, {-1} )

There are two convex functions 1/2^m and 1/(2^m-1),
I’m using cvx to make the first convex function less than or equal to a number,this is a convex set. As follow
cvx_begin
variables m n t x positive
minimize(m)
subject to
m>0;
pow_p(2^m,-1)<=10
cvx_end

but But if I put the second convex set in the constraint, I get an error. As follow,
cvx_begin
variables m n t x positive
minimize(m)
subject to
m>0;
pow_p(2^m-1,-1)<=10
cvx_end

output:
Disciplined convex programming error:
Illegal operation: pow_p( {convex}, {-1} )
How to fix it :slight_smile:

The normal rules of pow_p are violated in both cases:

help pow_p

pow_p Positive branch of the power function.
pow_p(X,P) computes a convex or concave branch of the power function:
P < 0: pow_p(X,P) = X.^P if X > 0, +Inf otherwise
0 <= P < 1: pow_p(X,P) = X.^P if X >= 0, -Inf otherwise
1 <= P : pow_p(X,P) = X.^P if X >= 0, +Inf otherwise
Both P and X must be real.

Disciplined convex programming information:
    The geometry of pow_p(X,P) depends on the precise value of P,
    which must be a real constant:
             P < 0: convex  and nonincreasing; X must be concave.
        0 <= P < 1: concave and nondecreasing; X must be concave.
        1 <= P    : convex  and nonmonotonic;  X must be affine.
    In all cases, X must be real.

However, the first, but not the second, of 1/2^m and 1/(2^m-1) satisfies the special log-affine rules documented in Log of sigmoid function - #3 by mcg (that should be in the CVX Users’ Guide, but isn’t).

So you will have to manually reformulate.
1/(2^m-1) <= 10 can be reformulated as (approximately) m >= 0.1375, which is an affine constraint, and therefore will be accepted by CVX.