How to write these function with disciplined convex programming rule to use CVX? x*(2^(y/x)-1)

775 Views Asked by At

I have the following functions in an optimization problem.

$x\times 2^{(y/x)-1}$

$ x \log (a+b\times 2^{(y/cx)-1} )$

Here, x,y>0, and also a,b,c>0, and b>a. For these conditions, I checked that both these functions are convex (their Hessian is positive semidefinite). If I want to solve the optimization problem using CVX, I need to write these functions using a disciplined convex programming rule. Can anyone please help me how to do that? Even the first function has affine divided by affine form, and therefore, I am getting an error when running the code with only the first function. Many thanks for your help.

2

There are 2 best solutions below

2
On

If $f$ is convex, then the perspective $$g(x,t) = t \, f(x / t)$$ is convex.

Your first function is the perspective of $$f(y) = 2^{y - 1}$$ which is convex. The second function is the perspective of $$ f(y) = \log( a + b \, 2^{y/c -1})$$ which is also convex.

Maybe you can invoke the perspective function in CVX.

1
On

$x\times 2^{(y/x)-1}$ can be reformulated as $\frac{1}{2log(2)}xe^\frac{y}{x}$

If this appears in an objective function, replace $x\times 2^{(y/x)-1}$ with $z$, where $z$ is declared a variable in CVX; and add the constraint, {y,x,2*log(2)*z} == exponential(1) to specify an exponential cone constraint, x*exp(y/x) <= 2*log(2)*z)

If it appears in a constraint: $x\times 2^{(y/x)-1} \le z$, handle it in a similar manner to what I showed for appearance in the objective function, except z need not be declared a variable, unless it already is a variable.

I leave $ x \log (a+b\times 2^{(y/cx)-1} )$ to you as an exercise.