# Rotated cone constraint, how to include it?

**URL:** <https://discourse.julialang.org/t/rotated-cone-constraint-how-to-include-it/3879>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [May 23, 2017, 2:14pm UTC](https://discourse.julialang.org/t/rotated-cone-constraint-how-to-include-it/3879 "2017-05-23T14:14:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rayset](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rayset](https://discourse.julialang.org/u/rayset)\
**Post date:** [May 23, 2017, 2:14pm UTC](https://discourse.julialang.org/t/rotated-cone-constraint-how-to-include-it/3879/1 "2017-05-23T14:14:38Z")

</div>

I’ve been trying for a few days to add the following constraint in jump:

> @NLconstraint(mod, R[i,j,h]^2 + T[i,j,h]^2 - 2\*u\_ijk[i,i,j,h]\*u\_ijk[j,j,i,h]\<=0)

I tried every academic solver, but none is able to recognize that it is a rotated cone constraint.  
I found ways to declare second order cone constraints (not rotated) that should work with pajarito and Gurobi, yet I didn’t manage to put my constraint in the required form.

Is there a solver that supports this kind of constraints or a standard procedure to reformulate it? having more than 100 of those constraints the difference between a NLconstraint and a conic one is huge (and atm nlsolvers are giving me suboptimal solutions).

Thanks for the help

---

<div class="post-metadata">

**Author:** ![miles.lubin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miles.lubin/32/279_2.png) [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Post date:** [May 23, 2017, 3:04pm UTC](https://discourse.julialang.org/t/rotated-cone-constraint-how-to-include-it/3879/2 "2017-05-23T15:04:33Z")

</div>

The commercial MISOCP solvers (Gurobi, CPLEX, and Mosek) will currently accept rotated SOCs in quadratic form:

```julia
@constraint(mod, R[i,j,h]^2 + T[i,j,h]^2 - 2*u_ijk[i,i,j,h]*u_ijk[j,j,i,h]<=0)

```

For other solvers that are expecting plain SOCs, you can [manually transform](http://docs.mosek.com/modeling-cookbook/cqo.html#rotated-quadratic-cones) rotated SOCs into SOCs and use JuMP’s `norm()` [syntax](http://www.juliaopt.org/JuMP.jl/0.16/refmodel.html#second-order-cone-constraints).

We’re planning on making it easier to input rotated SOCs in JuMP over the summer.

---

<div class="post-metadata">

**Author:** ![rayset](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@rayset](https://discourse.julialang.org/u/rayset)\
**Post date:** [May 24, 2017, 12:13pm UTC](https://discourse.julialang.org/t/rotated-cone-constraint-how-to-include-it/3879/3 "2017-05-24T12:13:01Z")

</div>

you are absolutely right, it kept giving me errors on gurobi for the declaration of NLconstraint.  
thanks a lot!
