Second order conce constraints.
SOCConstraint(normedExpression, upperBound, customString=None)¶
Second order (-norm, Lorentz) cone membership constraint.
__init__(normedExpression, upperBound, customString=None)¶
The constraint in Euclidean norm unit ball membership form.
If this constraint has the form with constant and an affine expression of a single (matrix) variable with for some invertible matrix and a vector , then we have and we can write the elementwise vectorization of the constraint’s feasible region as
Therefor we can repose the constraint as two constraints:
This method returns the quadruple where is a fresh real variable vector (the same for subsequent calls) and is the Euclidean norm unit ball.
>>> import picos >>> A = picos.Constant("A", [[2, 0], ... [0, 1]]) >>> x = picos.RealVariable("x", 2) >>> P = picos.Problem() >>> P.set_objective("max", picos.sum(x)) >>> C = P.add_constraint(abs(A*x + 1) <= 10) >>> _ = P.solve(solver="cvxopt") >>> print(x) [ 1.74e+00] [ 7.94e+00] >>> Q = picos.Problem() >>> Q.set_objective("max", picos.sum(x)) >>> x, aff_y, y, B, = C.unit_ball_form >>> _ = Q.add_constraint(x == aff_y) >>> _ = Q.add_constraint(y << B) >>> _ = Q.solve(solver="cvxopt") >>> print(x) [ 1.74e+00] [ 7.94e+00] >>> round(abs(P.value - Q.value), 4) 0.0 >>> round(y**2 + y**2, 4) 1.0