pabloazurduy / qp-mip

a quadratic linealization example, using python-mip library and coinOR solver
0 stars 0 forks source link
article linearization mip qp-mip

linear QP code

Solving a Quadratic Problem (QP) in an open source linear solver (python-mip)

qp-mip-example. This code is more explained in this medium post

Installation

cd qp-mip
pip install .

Usage

both models in the example are in model.py module, the helper described in the article is in helpers.mip. The result plots are in the result\ folder.

some of the equations latex code used in the article are in the model.tex file

Model

model_lineal

Linearization of the quadratic function

quadratic_function_discrete

Results linear version

linear model

Results quadratic version

quadratic model