Cannot perform the operation: {log-affine} .* {convex}

Hello everyone,

I am a newbie and need to help on this question.

When I run this problem in CVX

echo on
cvx_begin gp
variable x(1) nonnegative
minimize(x.*(2.^x-1))
cvx_end
echo off

I received an error that “Cannot perform the operation: {log-affine} .* {convex}”. I think the objective function x*(2^x-1) is convex.

How can I solve this error?

Thank you :slight_smile:

Don’t use gp mode, and follow the post by @Michal_Adamaszek in Interpolation error after rewriting x*2^x,as x*exp(x*log(2)).

1 Like