Skip to main content

`myopenopt` is a package for myopenopt.

Project description

Myopenopt is a wrapper module for openopt. It supports to call openopt using the same functions and classes as in Gurobi, a commercial mixed integer optimization solver. For more details, see the Gurobi HP http://www.gurobi.com/.

from myopenopt import *
model = Model("sample", mtype='NLP')
x1 = model.addVar(vtype="C", name="x1")
x2 = model.addVar(vtype="C", name="x2")
x3 = model.addVar(vtype="C", ub=10, name="x3")
model.update()
c1 = model.addConstr(x1**2 + 2*x2**2 <= x3**2, name="C1")
c2 = model.addConstr(x3 <= 30, name="C2")
c3 = model.addConstr(quicksum([x1, x2, x3]) <= 20, name="C3" )
model.setObjective(15*x1 + 18*x2 + 30*x3, GRB.MAXIMIZE)
print(model)
model.optimize(solver="ralg")
print("Result =", model.Status)
for v in model.getVars():
    print(v.VarName, v.X)

Requirements

  • Python 3.7 and openopt, FuncDesigner

Features

  • nothing

Setup

Add compiler path(ex. C:\Anaconda3\MinGW\bin)
$ pip install openopt
$ pip install FuncDesigner
$ pip install myopenopt

History

0.0.1 (2015-5-4)

  • first release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for myopenopt, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size myopenopt-0.0.3-py3-none-any.whl (3.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size myopenopt-0.0.3.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page