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

Uncategorized
Dec 21, 2022
A

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


M

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

A
Replying to #2

WOW vert helpful Nice Mark

A
Replying to #2

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


how to solve it

M

-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?

A
Replying to #5

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

M

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…

A
Replying to #7

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

M

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

A
Replying to #9

You are very handsome Mark. I solved !

M

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

A
Replying to #11

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

A
Replying to #2

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

M

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.