!Cannot perform the operation: {real affine} ./ {real affine}

Uncategorized
Feb 16, 2022
C

One term of objective function:
(W(1,1)*n_0/h_ESi(1)*(exp(log(2)*(x(1,1))/W(1,1)*(1/t1))-1))*t1+...
where x and W are variables.
It has been proved to be a convex function.
I’d like to ask what function should be used here.

C

Essentially equivalent to
W×(exp(log(2)×(x)/W)-1)

M

I will assume W > 0. This can be handled with exponential cone constraint.

variables W x z
{log(2)*x,W,z} == exponential(1)
z - W  % Use in place of W×exp(log(2)*x/W)-1)

In your original problem, you would use log(2)*t1*x as the first argument on the LHS.

C
Replying to #4

Thank you for your reply. Can you explain it in detail from the perspective of code implementation? In addition, is there no function in CVX that can calculate b × (2 ^ (a / b) - 1)?
In essence, the formula is a deformation of b × log(1+a/b).

C
Replying to #4

And, in fact, W > 0, x ≥ 0.

M

I provided the detailed code implementation.

y*2^(x/y) = y*exp(log(2)*x/y) , which is what I guess you already had. CVX also does not support log2(cvx_expression),, which you need to rewrite as log(cvx_expressio)/log(2).

C
Replying to #7

Thank you very much for your help. I understand. I will try to modify the code.

M

BTW, b * log(1+a/b) can be expressed as -rel_entr(b,b+a)