MultiJuMP AND CPLEX

Hello,

I have a problem with discrete and continous variable, I want to use CPLEX with MultiJuMP, but I get this error :


ERROR: MethodError: no method matching NonlinearModel(::CPLEX.CplexSolver)
Closest candidates are:
  NonlinearModel(::Ipopt.IpoptSolver) at /home/monpc/.julia/v0.6/Ipopt/src/IpoptSolverInterface.jl:28
  NonlinearModel(::Int64) at /home/monpc/.julia/v0.6/MathProgBase/src/SolverInterface/SolverInterface.jl:27
  NonlinearModel() at /home/monpc/.julia/v0.6/MathProgBase/src/SolverInterface/SolverInterface.jl:25
Stacktrace:
 [1] _buildInternalModel_nlp(::JuMP.Model, ::JuMP.ProblemTraits) at /home/monpc/.julia/v0.6/JuMP/src/nlp.jl:1246
 [2] #build#119(::Bool, ::Bool, ::JuMP.ProblemTraits, ::Function, ::JuMP.Model) at /home/monpc/.julia/v0.6/JuMP/src/solvers.jl:303
 [3] (::JuMP.#kw##build)(::Array{Any,1}, ::JuMP.#build, ::JuMP.Model) at ./<missing>:0
 [4] #solve#116(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at /home/monpc/.julia/v0.6/JuMP/src/solvers.jl:168
 [5] (::JuMP.#kw##solve)(::Array{Any,1}, ::JuMP.#solve, ::JuMP.Model) at ./<missing>:0
 [6] _solve_nbi(::JuMP.Model, ::Bool) at /home/monpc/.julia/v0.6/MultiJuMP/src/MultiJuMP.jl:180
 [7] #solvehook#11(::Symbol, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at /home/monpc/.julia/v0.6/MultiJuMP/src/MultiJuMP.jl:333
 [8] (::MultiJuMP.#kw##solvehook)(::Array{Any,1}, ::MultiJuMP.#solvehook, ::JuMP.Model) at ./<missing>:0
 [9] #solve#116(::Bool, ::Bool, ::Bool, ::Array{Any,1}, ::Function, ::JuMP.Model) at /home/monpc/.julia/v0.6/JuMP/src/solvers.jl:151
 [10] (::JuMP.#kw##solve)(::Array{Any,1}, ::JuMP.#solve, ::JuMP.Model) at ./<missing>:0

How I can solve it ? thanks

It looks like you are trying to solve a nonlinear model. CPLEX is only for mixed-integer quadratic problems.

To be of more help, you should post a minimum working example.

1 Like

YES, I have a quadratic problem.

Hi, I wrote MultiJuMP a few years back focusing on continuous nonlinear problems, so it currently only supports nonlinear solvers (such as Ipopt, NLopt, and Knitro).

If there is a particular reason for why you want to use solvers that don’t support NLP then MultiJuMP would need some more code. It is probably not too difficult to support problems with more structure, so if you figure out a way to do it please submit a PR :slight_smile: (Even if it’s only for a subset of the methods (:WS, :EPS, :NBI)