JuMP for Gurobi 9.0

I want to use the latest version of Gurobi Solver (Gurobi 9.0) since it uses to solve convex and non convex problems unlike the previous versions. On the other hand, JuMP is working for versions up to Gurobi 8.1. Any suggestions how to handle this problem?
It says “The solver does not support nonlinear problems (i.e., NLobjective and NLconstraint).”
Below I leave the error messages of my JuMP code:

Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(optimize!), ::Model, ::Nothing) at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:147
 [3] macro expansion at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:111 [inlined]
 [4] general_equi_NLP(::Int64, ::Int64, ::Int64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Float64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}) at .\In[123]:110
 [5] top-level scope at In[125]:1  ```

Does Gurobi.jl build at all? From just that stacktrace it’s unclear what your error is. What does your Project.toml look like, and what do you see if you enter package mode in the REPL (]) and get the environment status (st)?

I ask because it looks like the most recent version of Gurobi.jl does support Gurobi 9.0, and doing ]add JuMP Gurobi in a fresh environment will attempt to install this recent version.

I think the error message “The solver does not support nonlinear problems (i.e., NLobjective and NLconstraint).” is important. Because I am using Gurobi as a solver. My be there might be other way of stating nonlinear problems in Gurobi. But the problem is related to the expressions @NLconstraint and @NLobjective. In JuMP this is the way to use for nonlinear programming as far as I know. The environment has no problem and it is updated as well.

  Updating `C:\Users\Utente\.julia\environments\v1.3\Project.toml`
 [no changes]
  Updating `C:\Users\Utente\.julia\environments\v1.3\Manifest.toml`
 [no changes]```

If you’re referring to Gurobi’s support for nonconvex quadratic expressions, use @constraint and @objective instead of @NLconstraint and @NLobjective.

1 Like

Thanks! This way it seems working. But I have another error which was not there while I was using Ipopt solver. It says “Gurobi.GurobiError(10020, “Q matrix is not positive semi-definite (PSD)”)”. FYI. I have a parameter Q which I generated randomly.

 [1] optimize at C:\Users\Utente\.julia\packages\Gurobi\CI8ht\src\grb_solve.jl:7 [inlined]
 [2] optimize!(::Gurobi.Optimizer) at C:\Users\Utente\.julia\packages\Gurobi\CI8ht\src\MOI_wrapper.jl:1803
 [3] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}) at C:\Users\Utente\.julia\packages\MathOptInterface\C1XBe\src\Bridges\bridge_optimizer.jl:239
 [4] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at C:\Users\Utente\.julia\packages\MathOptInterface\C1XBe\src\Utilities\cachingoptimizer.jl:189
 [5] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(optimize!), ::Model, ::Nothing) at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:141
 [6] macro expansion at C:\Users\Utente\.julia\packages\JuMP\MsUSY\src\optimizer_interface.jl:111 [inlined]
 [7] general_equi_NLP(::Int64, ::Int64, ::Int64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Float64, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}, ::Array{Float64,1}) at .\In[10]:111
 [8] top-level scope at In[11]:1