# Maximizing a Ratio/Percent

I'm using cvxpy to model a problem. Inside a very large and complex LP, I create two continuous, affine (unconstrained) expressions: $$x$$ and $$y$$. Due to how they are created, I know that $$0\lt x \lt y \leq U$$. Obviously: $$x/y \lt 1$$.

In my LP objective, how do I maximize the ratio $$x/y$$?

Things I tried:

• Maximizing x*cp.invpos(y) states my problem is non DCP (also if I try to minimize the inverse)
• I found various LP formulations for maximizing ratios (e.g. here or here) but these requires rewriting the constraints on all the terms in the expressions for $$x$$ - I have no idea how to do that with cvxpy.
If this is the way to go then an example would be very helpful!
• @Mason the measure I need to maximize needs to be a “unitless” proportion between 0-1 so that it it properly scaled with other measures in the objective. – Adi Shavit Oct 15 at 18:05