Log{convex} log(1+1/(1+x))


(Kirti Kant Sharma) #1

log(1+1/(1+x)) is a convex function over a<=x<=b, a,b>0, so how can i implement it in cvx?


(Michael C. Grant) #2

Just because it’s convex doesn’t mean CVX can implement it. It does not claim to be able to handy any and all convex problems. Please read the FAQ.


(Michael C. Grant) #3

You may be able to use a polynomial approximation; please see the function reference for the use of polyval.


(Kirti Kant Sharma) #4

Thank you for quick reply. I also find on the forum a way to do this


(Michael C. Grant) #5

Hey that’s a good find! Share here if you find a solution to your particular case.

It’s actually very useful to understand that you really never need to know how to “implement” a function f(x). Rather, you need a way to implement the inequality f(x) \leq y (or, f(x) \geq y if f is concave). Any set of equations that returns the same subset on (x,y) is a valid implementation of f(x) \leq y. That’s what the user is doing in that post.