# How to solving SOCP and SDP by AmplNLWriter with these two solvers GUROBI 11.0.3 and Lindoapi 15?

**URL:** https://discourse.julialang.org/t/how-to-solving-socp-and-sdp-by-amplnlwriter-with-these-two-solvers-gurobi-11-0-3-and-lindoapi-15/121322
**Category:** Optimization (Mathematical)
**Created:** [October 15, 2024, 9:55am UTC](https://discourse.julialang.org/t/how-to-solving-socp-and-sdp-by-amplnlwriter-with-these-two-solvers-gurobi-11-0-3-and-lindoapi-15/121322 "2024-10-15T09:55:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wjulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wjulia/32/45921_2.png) [@wjulia](https://discourse.julialang.org/u/wjulia)
#### Post date: [October 15, 2024, 9:55am UTC](https://discourse.julialang.org/t/how-to-solving-socp-and-sdp-by-amplnlwriter-with-these-two-solvers-gurobi-11-0-3-and-lindoapi-15/121322/1 "2024-10-15T09:55:47Z")

</div>

hello, everyone,

what is wrong with the following code of

```julia

using JuMP
using AmplNLWriter
using LinearAlgebra
using SCS
using MathOptInterface
# import MathOptInterface as MOI

model = Model(() -> AmplNLWriter.Optimizer("Your_Path\\ampl\\gurobi.exe",["outlev=1"]))
# model = Model(() -> AmplNLWriter.Optimizer("Your_Path\\runlindo.exe",["-sol","-gop"]))
 
C = [1.0 -1.0; -1.0 2.0]
@variable(model, X[1:2, 1:2], PSD)
@variable(model, z[1:2] >= 0)
@objective(model, Min, tr(C*X))
@constraint(model, c1, X[1, 1] - z[1] == 1)
@constraint(model, c2, X[2, 2] - z[2] == 1)

optimize!(model)

```

It didn’t work with errors:

```julia
julia> optimize!(model)
ERROR: UnsupportedConstraint: `MathOptInterface.VectorOfVariables`-in-`MathOptInterface.PositiveSemidefiniteConeTriangle` constraints are not supported by the
solver you have chosen, and we could not reformulate your model into a
form that is supported.

To fix this error you must choose a different solver.

```

Owo, AmplNLWrite does not support Conic Optimization, SOCP and SDP with solvers GUROBI 11.0.3 and Lindoapi 15.

How to solving SOCP and SDP by AmplNLWriter with these two solvers GUROBI 11.0.3 and Lindoapi 15?

Thanks.  
Aijunly WANG.

---

<div class="post-metadata">

### Author: ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)
#### Post date: [October 15, 2024, 9:38pm UTC](https://discourse.julialang.org/t/how-to-solving-socp-and-sdp-by-amplnlwriter-with-these-two-solvers-gurobi-11-0-3-and-lindoapi-15/121322/2 "2024-10-15T21:38:32Z")

</div>

AmplNLWriter does not support PSD constraints, and neither does Gurobi.

Following the error message:

> To fix this error you must choose a different solver.

You cannot solve this model using AmplNLWriter or Gurobi. You must pick a different solver (like SCS).

---

<div class="post-metadata">

### Author: ![wjulia](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wjulia/32/45921_2.png) [@wjulia](https://discourse.julialang.org/u/wjulia)
#### Post date: [October 16, 2024, 2:58am UTC](https://discourse.julialang.org/t/how-to-solving-socp-and-sdp-by-amplnlwriter-with-these-two-solvers-gurobi-11-0-3-and-lindoapi-15/121322/3 "2024-10-16T02:58:28Z")

</div>

Ok, Thanks.
