GithubHelp home page GithubHelp logo

couennenl.jl's Introduction

CouenneNL

Build Status Build status codecov.io

This package is a very thin wrapper on top of https://github.com/JuliaOpt/AmplNLWriter.jl that automatically downloads an appropriate Couenne solver binary from https://ampl.com/products/solvers/open-source/ . CouenneNL.jl provides the CouenneNLSolver type, which is a wrapper around the AmplNLSolver from AmplNLWriter.jl.

Requirements

  • Julia v0.6
  • Windows, macOS, or Linux

Installation

julia> Pkg.clone("https://github.com/rdeits/CouenneNL.jl")

julia> Pkg.build("CouenneNL")

Usage

using JuMP, CouenneNL

m = Model(solver=CouenneNLSolver())
@variable m -2 <= x <= 2
@variable m -2 <= y <= 2
@NLconstraint m x^2 + y^2 == 1
@NLobjective m Min (x - 0.1)^2 + (y - 0.1)^2
solve(m)
@test getvalue(x)  1/√2
@test getvalue(y)  1/√2

couennenl.jl's People

Contributors

rdeits avatar tkoolen avatar juliatagbot avatar

Stargazers

Páll Haraldsson avatar David P. Sanders avatar Changhyun Kwon avatar Chris Coey avatar Carleton Coffrin avatar

Watchers

 avatar James Cloos avatar Carleton Coffrin avatar  avatar

Forkers

tkoolen

couennenl.jl's Issues

Can't evaluate a constraint

Trying to run the following code:

using JuMP, CouenneNL

## Solve test problem
 #
 #  min   2*x1 + 3*x2 + 1.5*y1 + 2*y2 - 0.5*y3
 #  s.t.  x1^2 + y1 = 1.25
 #        x2^1.5 + 1.5y2 = 3
 #        x1 + y1 <= 1.6
 #        1.333*x2 + y2 <= 3
 #        -y1-y2+y3 <= 0
 #        x1, x2 >= 0
 #        y1, y2, y3 binary
 ##

#m = Model(solver=AmplNLSolver(CoinOptServices.couenne))
m = Model(solver=CouenneNLSolver())
@variable(m, X[i=1:2] >= 0)
@variable(m, y[i=1:3], Bin)

@NLobjective(m, Min, 2*X[1] + 3*X[2] + 1.5*y[1] + 2*y[2] - 0.5*y[3])

@NLconstraint(m,  X[1]^2 + y[1] == 1.25)
@NLconstraint(m, X[2]^(3/2) + 1.5*y[2] == 3)
@NLconstraint(m, X[1] + y[1] <= 1.6)
@NLconstraint(m, 1.333*X[2] + y[2] <= 3)
@NLconstraint(m, -y[1]-y[2]+y[3] <= 0)

print(m)

status = solve(m)

println("Objective value: ", getobjectivevalue(m))
println("y = ", getvalue(y))
println("x = ", getvalue(X))

I get the following error:

ANALYSIS TEST: Error evaluating constraint 2: can't evaluate pow"(0,1.5).
WARNING: Not solved to optimality, status: Error
Objective value: NaN
WARNING: Variable value not defined for component of y. Check that the model was properly solved.
y = [NaN, NaN, NaN]
WARNING: Variable value not defined for component of X. Check that the model was properly solved.
x = [NaN, NaN]

Couenne doesn't support non-integer exponent in the constraints? Or is this some sort of bug?

Error when cloning

Hello, i got the following error:

julia> Pkg.clone("https://github.com/rdeits/CounneNL.jl")
INFO: Cloning CounneNL from https://github.com/rdeits/CounneNL.jl
ERROR: GitError(Code:ERROR, Class:Net, Request failed with status code: 404)

When i type the "Pkg.clone...." comand, it asks me for my Github username and password. I type them, then i get that error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.