julia> @constraint(model, [t, x[1], x[2]] in SecondOrderCone())
[t, x[1], x[2]] in MathOptInterface.SecondOrderCone(3)
上述代码等价于下式:
||x[1]^2 + x[2]^2||\_2 ≤ t
and t ≥ 0
.
julia> @constraint(model, [t, u, x[1], x[2]] in RotatedSecondOrderCone())
[t, u, x[1], x[2]] in MathOptInterface.RotatedSecondOrderCone(4)
上述代码等价于下式:
: ||x[1]^2 + x[2]^2||\_2 ≤ t × u
and t, u ≥ 0
.
若||x[1]^2 + x[2]^2+x[3]^2||\_2 ≤ t
and t ≥ 0
.
该如何编写代码呢?