Code Monkey home page Code Monkey logo

complementarity.jl's Introduction

Complementarity.jl

Build Status codecov

This package provides modeling language for (1) mixed complementarity problems (MCP) and (2) mathematical programs with equilibrium problems (MPEC).

NOTE @complmentarity for MCP and @complements for MPEC.

Mixed Complementarity Problems (MCP)

NOTE: The PATHSolver.jl has been completely rewritten between v0.6.2 and v1.1.0. Now PATHSolver.jl provides both an interface to the PATH solver and an integration to JuMP, but only limited to linear problems at this moment. For nonlinear problems, you still need to use Complementarity.jl, which now also uses the new PATHSolver.jl as its solver. Most parts of Complementarity.jl remain the same, except how the solver options are passed.

MCP Documentation

F(x) ⟂ lb ≤ x ≤ ub

A very simple example:

(x+2) x = 0,  x ≥ 0,   x+2 ≥ 0
using Complementarity, JuMP
m = MCPModel()
@variable(m, x >= 0)
@mapping(m, F, x+2)
@complementarity(m, F, x)
status = solveMCP(m)
@show result_value(x)

Mathematical Programs with Equilibrium Constraints (MPEC)

NOTE: For solving MPEC, JuMP.jl v0.21 has started supporting complementarity constraints. At this moment, GAMS.jl and KNITRO support complementarity constraints.

MPEC Documentation

min  f(x)
s.t. g(x) ≤ 0
     F(x) ⟂ lb ≤ x ≤ ub

A very simple example:

min  x^3
s.t. (x+2) x = 0,  x ≥ 0,   x+2 ≥ 0
using JuMP, Ipopt, Complementarity
m = Model(solver=IpoptSolver())
@variable(m, x>=0)
@NLobjective(m, Min, x^3)
@complements(m, 0 <= x+2,   x >= 0)
solve(m)
@show getvalue(x)

Installation

Pkg.add("Complementarity")

This will also install a few other packages.

complementarity.jl's People

Contributors

chkwon avatar davidanthoff avatar odow avatar pkofod avatar staticfloat avatar tkelman avatar

Watchers

 avatar  avatar

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.