# Mosek and Ipopt

**URL:** <https://discourse.julialang.org/t/mosek-and-ipopt/72334>\
**Category:** Optimization (Mathematical)\
**Created:** [December 1, 2021, 2:18am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334 "2021-12-01T02:18:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xuekui\_wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuekui_wang/32/30746_2.png) [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Post date:** [December 1, 2021, 2:18am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334/1 "2021-12-01T02:18:10Z")

</div>

when I use Ipopt as folows:

```julia
m = Model(Ipopt.Optimizer)
set_optimizer_attributes(m, "LOG" => 0)
...
g_p_max_soc=vcat(node[i].p̅ - g_p[i],arg_p)
@constraint(m, g_p_max_soc in SecondOrderCone())

```

there are errors as below:

```julia
MOI.VectorAffineFunction{Float64}`-in-`MOI.SecondOrderCone` constraints are not supported and cannot be bridged into supported constrained variables and constraints. See details below:

```

but when I use Mosek solver instead

```julia
m = Model(Mosek.Optimizer)
set_optimizer_attributes(m, "LOG" => 0)

```

The porgram is ok. I don’t know why. Thanks for your reply.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [December 1, 2021, 3:01am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334/2 "2021-12-01T03:01:38Z")

</div>

If you look here: [Installation Guide · JuMP](https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers), it lists the solvers and what kinds of problems they support. Optimization with a constraint with `SecondOrderCone()` like you have is called SOCP (second-order cone programming), so you need a solver that supports that, like Mosek. As the error message says, Ipopt doesn’t support that kind of problem, and JuMP can’t automatically reformulate the problem in a way that Ipopt does support.

---

<div class="post-metadata">

**Author:** ![Xuekui\_wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuekui_wang/32/30746_2.png) [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Post date:** [December 1, 2021, 7:15am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334/3 "2021-12-01T07:15:54Z")

</div>

Thank you very much, I have known it.  
I thougt Ipopt could solve socp problem, until I just saw this instruction manual

---

<div class="post-metadata">

**Author:** ![ccoffrin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ccoffrin/32/400_2.png) [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Post date:** [December 1, 2021, 5:44pm UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334/4 "2021-12-01T17:44:13Z")

</div>

Side note, if you reformulate your `SecondOrderCone` constraint in a polynomial or QCQP form then you can send it to Ipopt.

---

<div class="post-metadata">

**Author:** ![Xuekui\_wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xuekui_wang/32/30746_2.png) [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Post date:** [December 2, 2021, 2:13am UTC](https://discourse.julialang.org/t/mosek-and-ipopt/72334/5 "2021-12-02T02:13:57Z")

</div>

Ok，thank you @ericphanson , I tried Gurobi solver, program could work well.  
Also, thank you @ccoffrin , I will try reformulate `SecondOrderCone` constraint in a polynomial or QCQP form, and solve problem with Ipopt.
