'cvxpy.min or cvxpy.max in constraints

The following is my code:

import cvxpy as cp

alpha = 0.3
lamda_1 = 0.5
lamda_2 = 1.2

mu1 = cp.Variable(pos=True)
mu2 = cp.Variable(pos=True)
p_ev_max = 50
eps = 0.05
S1 = cp.Variable(pos=True)
S2 = cp.Variable(pos=True)
S = cp.Parameter(pos=True)
S.value = 200
# time resolution is 15 mins
obj = cp.Minimize(1/(mu1 - lamda_1)+1/(mu2 - lamda_2))
constraints = [
    mu1 == cp.min(p_ev_max, (1+eps)*S1),
    mu2 == cp.min(p_ev_max, (1+eps)*S2),
    S == S1 + S2,
]
prob = cp.Problem(objective= obj, constraints = constraints)
prob.solve(gp=True, requires_grad=True)

I get this error for using cp.min function:

Traceback (most recent call last):
  File "<input>", line 32, in <module>
  File "~/Library/Python/3.8/lib/python/site-packages/cvxpy/expressions/expression.py", line 661, in __lt__
    raise NotImplementedError("Strict inequalities are not allowed.")
NotImplementedError: Strict inequalities are not allowed.

I wonder how I am supposed to use the cvxpy min max function. I searched for the error but they were not relevant to using cp.min in the constraints.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source