lanl-ansi / Alpine.jl

A Julia/JuMP-based Global Optimization Solver for Non-convex Programs
https://lanl-ansi.github.io/Alpine.jl/latest/
Other
244 stars 39 forks source link

How to use POD on Julia 1.0 #92

Closed mmerakli closed 5 years ago

mmerakli commented 5 years ago

The following code gives the error "Problem is a MINLP and no MINLP local solver given; use minlp_solver to specify a MINLP local solver."

This used to work on 0.6. Do I need to change anything or is this expected?

solver = PODSolver(nlp_solver=IpoptSolver(print_level=0), mip_solver=GurobiSolver(OutputFlag=0))
m = Model(solver = solver)
@variable(m, x, Bin)
@NLconstraint(m, sin(x) >= 0.1)
solve(m)
harshangrjn commented 5 years ago

Yes! The support for automatic solver selection in v1.0 has been removed.

Just FYI, we do not currently support trigonometric functions.

mmerakli commented 5 years ago

@odow made the example. What should I do instead? I have nonlinear constraints with bilinear terms.

kaarthiksundar commented 5 years ago

@mmerakli

solver = PODSolver(minlp_solver="some MINLP solver", mip_solver=GurobiSolver(OutputFlag=0))
m = Model(solver = solver)
@variable(m, x, Bin)
@NLconstraint(m, sin(x) >= 0.1)
solve(m)

replace "some MINLP solver" with a suitable MINLP solver. Also, trigonometric functions are currently not supported. Just add your bilinear constraints using @NLconstraint and it should work.

ccoffrin commented 5 years ago

To avoid the trig function you can try something like,

@NLconstraint(m, x^3 - x^2 + 0.5>= 0.1)
odow commented 5 years ago

The real problem isn't trig, I just made that up (and obviously failed) as a MWE

harshangrjn commented 5 years ago

@odow If you have a MINLP, preferably use Bonmin as your local solver. Juniper.jl is also an alternative. But for a pure NLP, Ipopt will serve the purpose.

odow commented 5 years ago

We're just installing Bonmin now. This can be closed. (Although some documentation for POD would be nice :))

harshangrjn commented 5 years ago

@odow We agree and are working on a proper documentation. Thanks!