jump-dev / AmplNLWriter.jl

A Julia interface to AMPL-enabled solvers
http://ampl.com/products/solvers/all-solvers-for-ampl/
MIT License
65 stars 18 forks source link

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

Closed Aijunly closed 4 days ago

Aijunly commented 5 days ago

hello, everyone,

what is wrong with the following code of


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> 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.

odow commented 4 days ago

Closing because AmplNLWriter does not support PSD.

This has been cross-posted, so I'll answer this on Discourse: 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