How to deal with this convex problem by cvx


(Fahui Wu) #1

image

I write the constraint by :F(c)>=a^2 * inv_pos(b)
Disciplined convex programming error:
Cannot perform the operation: {convex} .* {convex}

I write the constraint by : F(c)>=a^2 /(b)
Cannot perform the operation: {convex} ./ {real affine}

How can I solve this problem by CVX?


(Mark L. Stone) #2

a^2/b, where a and b are both CVX (optimization) variables, is non-convex. Why isn't CVX accepting my model? READ THIS FIRST!

You haven’t shown us enough details of your problem for us to determine whether there may be a reformulation into a form acceptable by CVX. So for now, we will presume that the problem is not convex.

Edit: Ignore my post, except for the link. Go by ncg’s post below.


(Michael C. Grant) #3

Given that you seem to enforce that b is positive, quad_over_lin should work for you. But do read the FAQ to understand why your approach is wrong. If you understood how to properly use CVX you would not have even attempted it.


(Fahui Wu) #4

Thank you Michael, quad_over_lin work for me.
One more question, how to deal with the a^4/b^2, a and b are both positive variables. I had tried quad_over_lin(square(a),square(b)),
pow_p(a,4).*inv_pos(pow_p(b,2)), they both failed.


(Mark L. Stone) #5

square_pos(quad_over_lin(a,b))


(Michael C. Grant) #6

Fahui: again, please read the FAQ, and the user’s guide, particularly about the disciplined convex programming ruleset. You should not have even tried either of those approaches. Mark’s answer is of course correct.


(Mark L. Stone) #7

My minor atonement for the major whiff on my first post.