I'm working on an optimization problem using Python's CVXPY package. I created a CVXPY variable called x
(an array of 10 values). I need to impose a constraint that the 2nd largest value in x
is smaller than .03. I tried converting it to a NumPy array to no avail. How do I extract values from the x
array?
import cvxpy as cp
x = cp.Variable(10)