Cannot perform the operation: {positive constant} ./ {real affine} how to solve xlog2(1+b/x)

my code is here how to solve xlog2(1+b/x)

x*log2(1+b/x) can be reformulated as -rel_entr(x,x+b)/log(2)

WOW vert helpful Nice Mark

but i meet new problem, your method is useful, but the transformed formula is on the denominator

how to solve it

-rel_ebtr(x,x+b), with b > 0, is positive and concave, Therefore inv_pos(-rel_entr(x,x+b)) can be used in place of 1/(-rel_entr(x,x+b))

Dos that cover your situation?

thanks! Mark, but l have another question: how to reformulate x*log2(1+b/(c+dx))

This has been covered in previous posts on this forum. I’ll let you search for them or figure it out yourself, so that you will lean something in the process…

x*log2(1+a/(b+cx)) can reformulate as( (b+cx)log2(1+a/(b+cx)) - blog2(1+a/(b+cx)) )/c,and (b+cx)log2(1+a/(b+cx)) can reformulate as -rel_entr(b+cx,b+cx+a), but blog2(1+a/(b+cx)) I dont know how to reformulate

You can find many relevant posts by searching on this forum for
rel_entr . If you study the reformulations and their derivations, yol should be able to improve your ability to figure things out yourself.

Here is one of several which should help you

You are very handsome Mark. I solved !

You need to divide by log(2) because rel_entr uses MATLAB’s log, which is the natural log.

1 Like

Thanks Mark, I forgot to divide by log(2).

Why do I use them to calculate different results?It should be equivalent in theory

What “different results” are you referring to? The purpose of the reformulation is to create a mathematically equivalent formulation which CVX will accept. If the optimal solution is not unique, different mathematically equivalent formulations could produce different argmin’s, even though optimal objective value should be the same to within solver tolerance.