Can't get MINLP to work with nonlinear constraints

63 views
Skip to first unread message

anon

unread,
Nov 8, 2016, 6:13:28 AM11/8/16
to julia-opt
So I'm trying to run the code

using JuMP
using AmplNLWriter

model = Model(solver=CouenneNLSolver())

@variable(model, t)
@variable(model, -2 <= n <= 1, Int)

@NLconstraint(model, n^4 + n^3 - 2n^2 + 1 <= t)

@objective(model, Min, t)
solve(model, suppress_warnings=true)

println(getvalue(n))

but I get the error:

Error: LoadError: AssertionError: c.head == :comparison

How do I MINLP with nonlinear constraints?

Miles Lubin

unread,
Nov 8, 2016, 8:21:31 AM11/8/16
to julia-opt
Could you paste the output of versioninfo() and Pkg.status()?
Message has been deleted

anon

unread,
Nov 8, 2016, 8:53:11 AM11/8/16
to julia-opt
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)

8 required packages:
 - AmplNLWriter                  0.2.1
 - BARON                         0.1.1
 - Cbc                           0.2.0
 - CoinOptServices               0.1.0
 - JuMP                          0.13.1
 - KNITRO                        0.1.0
 - NLopt                         0.3.1
 - SCS                           0.2.1
17 additional packages:
 - BinDeps                       0.4.5
 - Calculus                      0.1.15
 - Clp                           0.2.0
 - Compat                        0.9.3
 - DataStructures                0.4.6
 - ForwardDiff                   0.1.8
 - Homebrew                      0.4.0
 - Ipopt                         0.2.1
 - JSON                          0.8.0
 - Lazy                          0.11.4
 - LightXML                      0.4.0
 - MacroTools                    0.3.2
 - MathProgBase                  0.4.3
 - NaNMath                       0.2.2
 - ReverseDiffSparse             0.5.6
 - SHA                           0.2.1
 - URIParser                     0.1.6

Miles Lubin

unread,
Nov 8, 2016, 8:55:30 AM11/8/16
to julia-opt
This issue was fixed in August (prior to the Julia 0.5 release). You should run Pkg.update()

anon

unread,
Nov 8, 2016, 9:11:17 AM11/8/16
to julia-opt
I just ran Pkg.update() and it said there was nothing to update
Message has been deleted

anon

unread,
Nov 8, 2016, 9:31:47 AM11/8/16
to julia-opt
So I went back to Julia 4.7 and now it works, so it appears to be a compatibility problem with Julia 5.0.

Miles Lubin

unread,
Nov 8, 2016, 9:32:26 AM11/8/16
to julia-opt
AmplNLWriter. The current release is 0.2.2 (soon 0.2.3).

On Tue, Nov 8, 2016 at 9:13 AM, anon <esp...@gmail.com> wrote:
What package were you hoping it would update?

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.

anon

unread,
Nov 8, 2016, 10:06:36 AM11/8/16
to julia-opt
It looks like for w/e reason Julia 0.5 can't find version 2.2.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+...@googlegroups.com.

Changhyun Kwon

unread,
Nov 8, 2016, 10:47:21 AM11/8/16
to juli...@googlegroups.com
JuMP requires       MathProgBase 0.5.1 0.6
BARON requires MathProgBase 0.4
AmPLWriter requires MathProgBase 0.5 0.6


When I tried to install BARON.jl in my system, it could not find a feasible version of MathProgBase.

I thinks the same issue affects updating AmplNLWriter to 0.2.2.


By the way, MathProgBase 0.4 means it requires 0.4 or higher, doesn’t it?



--



Miles Lubin

unread,
Nov 8, 2016, 10:53:15 AM11/8/16
to julia-opt

I don't see a version conflict there. You're correct that baron is only asking for 0.4 or higher.


To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

--



--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+unsubscribe@googlegroups.com.

Changhyun Kwon

unread,
Nov 8, 2016, 11:17:50 AM11/8/16
to juli...@googlegroups.com
I just found BARON.jl has this in its latest release:

MathProgBase 0.4 0.5





julia> Pkg.add("BARON")
ERROR: unsatisfiable package requirements detected: no feasible version could be found for package: MathProgBase
 in resolve(::Dict{String,Base.Pkg.Types.VersionSet}, ::Dict{String,Dict{VersionNumber,Base.Pkg.Types.Available}}) at ./pkg/resolve.jl:37
 in resolve(::Dict{String,Base.Pkg.Types.VersionSet}, ::Dict{String,Dict{VersionNumber,Base.Pkg.Types.Available}}, ::Dict{String,Tuple{VersionNumber,Bool}}, ::Dict{String,Base.Pkg.Types.Fixed}, ::Dict{String,VersionNumber}, ::Set{String}) at ./pkg/entry.jl:495
 in resolve(::Dict{String,Base.Pkg.Types.VersionSet}, ::Dict{String,Dict{VersionNumber,Base.Pkg.Types.Available}}, ::Dict{String,Tuple{VersionNumber,Bool}}, ::Dict{String,Base.Pkg.Types.Fixed}) at ./pkg/entry.jl:476
 in edit(::Function, ::String, ::Base.Pkg.Types.VersionSet, ::Vararg{Base.Pkg.Types.VersionSet,N}) at ./pkg/entry.jl:30
 in (::Base.Pkg.Entry.##2#5{String,Base.Pkg.Types.VersionSet})() at ./task.jl:360
 in sync_end() at ./task.jl:311
 in macro expansion at ./task.jl:327 [inlined]
 in add(::String, ::Base.Pkg.Types.VersionSet) at ./pkg/entry.jl:51
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#add,Tuple{String}}, ::String) at ./file.jl:59
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N}) at ./pkg/dir.jl:31
 in add(::String) at ./pkg/pkg.jl:100

julia> Pkg.installed("MathProgBase")
v"0.5.7"

Joey Huchette

unread,
Nov 8, 2016, 11:30:05 AM11/8/16
to julia-opt
No reason not to bump a new version of BARON, then (https://github.com/JuliaLang/METADATA.jl/pull/6980).

-Joey
Reply all
Reply to author
Forward
0 new messages