dummy-link

17

1

5

4

Complementarity.jl

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)

MCP Documentation

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 getvalue(x)
``````

Mathematical Programs with Equilibrium Constraints (MPEC)

MPEC Documentation

• For solving mathematical programs with equilibrium constraints (MPEC), this package provides an extension to JuMP.jl by providing a macro that accepts complementarity conditions as constraints. Then it reformulates the complementarity conditions as a set of equality and inequality constraints so that a nonlinear optimization solver such as Ipopt.jl can solve the problem. See the documentation. ```html 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.

04/27/2016

Last Touched

about 2 months ago

130 commits