Giter VIP home page Giter VIP logo

Comments (3)

ali5h avatar ali5h commented on August 16, 2024

I hade a more complicated problem which gave me the error:

ERROR: type: eval_g!: in typeassert, expected Float64, got GenericAffExpr{Float64,Variable}
 in eval_g! at /.../.julia/v0.3/ReverseDiffSparse/src/exprlist.jl:130
 in eval_g at /.../.julia/v0.3/JuMP/src/nlp.jl:274
 in initialize at /.../.julia/v0.3/JuMP/src/nlp.jl:203
 in loadnonlinearproblem! at /.../.julia/v0.3/Ipopt/src/IpoptSolverInterface.jl:269
 in solvenlp at /.../.julia/v0.3/JuMP/src/nlp.jl:474
 in solve at /.../.julia/v0.3/JuMP/src/solvers.jl:9
 in include at /usr/local/Cellar/julia/0.3.5_1/lib/julia/sys.dylib
 in include_from_node1 at /usr/local/Cellar/julia/0.3.5_1/lib/julia/sys.dylib
while loading /.../opt.jl, in expression starting on line 106

In that problem a and b in the above formula where affine expressions.

from ipopt.jl.

mlubin avatar mlubin commented on August 16, 2024

It's a known issue that you can't use affine expression objects inside @addNLConstraint. You can easily work around this by defining a new variable and setting it equal to the affine expression, e.g.,

@defVar(m, affvar)
@addConstraint(m, affvar == aff)
@addNLConstraint(m, cos(exp(affvar)) <= 0.5)

The first issue is likely because you're using homebrew's version of ipopt, which isn't supported in Julia. If you don't need it for other reasons, I'd just uninstall it and let Julia set up its own version with Pkg.build("Ipopt").

from ipopt.jl.

ali5h avatar ali5h commented on August 16, 2024

Thanks, problem resolved

from ipopt.jl.

Related Issues (20)

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.