Git Product home page Git Product 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: Differences between PATHSolver.jl and Complementarity.jl:

  • PATHSolver.jl provides a wrapper for the C API of the PATH solver.
  • PATHSolver.jl also enables JuMP for solving MCP, but limited to linear problems.
  • Complementarity.jl provides a JuMP extension for solving MCP, both linear and nonlinear, using the C API wrapper in PATHSolver.jl.

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(Ipopt.Optimizer)
@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.

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.