Inv_pos + DCP rules

97 views
Skip to first unread message

ayman chouayakh

unread,
Apr 8, 2021, 6:07:51 AM4/8/21
to cvxpy
Hi!

How to implement the following function for x>1 and y>0:
          
                                   1/(log x-y)   if  0.5 log x >=y
                                   1/(0.5 log x)   if 0.5  log x <=y

I have tried with the following function   inv_pos(log x-y+pos(y-0.5log x))  but that does not follow DCP rules.  Thank you in advance.

Yijie Zhao

unread,
Apr 8, 2021, 7:46:07 AM4/8/21
to cvxpy
Correct me if I'm wrong, but I don't think this is a convex function to begin with. If you plot it, there is an inward pointing section that makes the epigraph non-convex. 

For a numeric example, if we take (x1,y1) = (1.63, 0.25), (x2,y2) = (1.67, 0.25), then 1/2 f(x1,y1) + 1/2 f(x2,y2) !>= f(1/2 (x1,y1) + 1/2 (x2,y2)). 

ayman chouayakh

unread,
Apr 8, 2021, 8:09:47 AM4/8/21
to cvxpy
Yes you are right! thanks. In fact, in the original problem, for x>1, y >0, I have the function f1(x,y)= 1/(log x-y) defined for 0.5 log x >=y. This function is convex for that definition domain. I want to extend that function when y >= 0.5 log x  in such a way that the overall function still continuous and convex. I don't know if that is possible.
Reply all
Reply to author
Forward
0 new messages