How can I write an expression towards this problem's constrain to satisfy the DCP rule of cvxpy?

Question:

I am trying to create an expression of a constrain in cvxpy to solve an optimization problem. The following image shows the left side of constrain:

enter image description here

And t,a is the type of Variable. Therefore, I hope to know how to express ∑tlog(1+omega*a/t), I tried use the function of numpy.divide() in below, but it didn’t satisfy the DCP, the error is:

cons = [B*cp.sum (cp.multiply (t, cp.log( np.add( 1, a*np.divide(omega, t)))/cp.log(2))) <=constant] 
cvxpy.error.DCPError: Problem does not follow DCP rules. Specifically:
The following constraints are not DCP:
1.0 @ Sum(var2 @ (log(Promote(1.0, (2,)) + Promote(var1, (2,)) @ ([1. 2.] / var2)) / Promote(log(2.0), (2,))), None, False) <= 10.523561956057012 , because the following subexpressions are not:
|--  [1. 2.] / var2

Any help/insight will be appreciated. Thanks!

I am trying change the expression. But the function of cvxpy may be not enough.

Asked By: Tom_blade

||

Answers:

t * log(1+u/t) can be written in cvxpy as -rel_entr(t, u+t).

Answered By: Michal Adamaszek
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.