I have two variables p1, and p2. I am trying to minimize the ratio (p2/ 1 - p1) such that 0 <= p1 <= 1 and 0 <= p2 <= 1. I have the following code:
import cvxpy as cp
import numpy as np
p1 = cp.Variable()
p2 = cp.Variable()
constraints = [0 <= p1,
p1 <= 1,
0 <= p2,
p2 <= 1]
obj = cp.Minimize(p2 * cp.inv_pos(1 - p1))
prob = cp.Problem(obj, constraints)
prob.solve()
It shows 'DCPError: Problem does not follow DCP rules.' So, I tried prob.solve(qcp = True). It still shows the same error. Can anyone suggest me what modifications I need to make so that this problem can be solved by CVXpy?
Thanks!