Skip to main content

Special Structure Detection for Pyomo

Project description

Special Structure Detection for Pyomo

DOI travis codecov

This library implements methods to:

  • Detect convex and concave expressions

  • Detect increasing and decreasing expressions

  • Detect linear, quadratic and polynomial expressions

  • Tighten expression bounds

Please reference this software as

@Article{Suspect2019,
author={Ceccon, Francesco and Siirola, John D. and Misener, Ruth},
title={{SUSPECT}: {MINLP} special structure detector for Pyomo},
journal={Optimization Letters},
year={2019},
month={Feb},
issn="1862-4480",
doi="10.1007/s11590-019-01396-y",
url="https://doi.org/10.1007/s11590-019-01396-y"
}

Documentation

Documentation is available at https://cog-imperial.github.io/suspect/

Installation

SUSPECT requires Python 3.5 or later. We recommend installing SUSPECT in a virtual environment

To create the virtual environment run:

$ python3 -m venv myenv
$ source myenv/bin/activate

Then you are ready to clone and install SUSPECT:

$ git clone https://github.com/cog-imperial/suspect.git
$ cd suspect
$ pip install -r requirements.txt
$ pip install .

Command Line Usage

The package contains an utility to display structure information about a single problem.

You can run the utility as:

model_summary.py -p /path/to/problem.osil

or, if you want to check variables bounds include the solution:

model_summary.py -p /path/to/problem.osil -s /path/to/problem.sol

The repository also includes a Dockerfile to simplify running the utility in batch mode in a cloud environment. Refer to the batch folder for more information.

Library Usage

from suspect import detect_special_structure
import pyomo.environ as aml


model = aml.ConcreteModel()
model.x = aml.Var()
model.y = aml.Var()

model.obj = aml.Objective(expr=(model.y - model.x)**3)
model.c1 = aml.Constraint(expr=model.y - model.x >= 0)

info = detect_special_structure(model)

# try info.variables, info.objectives, and info.constraints
print(info.objectives['obj'])

License

Copyright 2018 Francesco Ceccon

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Acknowledgements

This work was funded by an Engineering & Physical Sciences Research Council Research Fellowship to RM [Grant Number EP/P016871/1].

Changelog

Next

1.1.0 (2019-01-31)

  • Add Quadratic expression type

  • Add Interval special case for x*x

  • Fix Interval sin

  • Add Interval comparison with numbers

1.0.7 (2018-08-30)

  • Add Interval abs

  • Add Interval power

1.0.6 (2018-07-05)

  • Change ExpressionType and UnaryFunctionType to IntEnum

1.0.5 (2018-07-05)

  • Documentation improvements

1.0.4 (2018-07-04)

  • First public release. Yay!

Project details


Download files

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

Source Distribution

cog-suspect-1.5.2.tar.gz (67.0 kB view details)

Uploaded Source

Built Distribution

cog_suspect-1.5.2-py3-none-any.whl (93.3 kB view details)

Uploaded Python 3

File details

Details for the file cog-suspect-1.5.2.tar.gz.

File metadata

  • Download URL: cog-suspect-1.5.2.tar.gz
  • Upload date:
  • Size: 67.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for cog-suspect-1.5.2.tar.gz
Algorithm Hash digest
SHA256 a7163672145fbe5a66fe18a90e3a102b21dc49b1034b172a90a159db2d76e894
MD5 276221e755cab8053a38eebb91c7a123
BLAKE2b-256 51b2ff446cf758eec77229de9af383a4d69a890c7fcf934c89d1b48e6ee01c02

See more details on using hashes here.

File details

Details for the file cog_suspect-1.5.2-py3-none-any.whl.

File metadata

  • Download URL: cog_suspect-1.5.2-py3-none-any.whl
  • Upload date:
  • Size: 93.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for cog_suspect-1.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 637cd96fde2b0977e6f602515d8e172068ff48e4704911458334cc176083d196
MD5 003837ad441d205a41a8097eabfce978
BLAKE2b-256 048a0a8e03eae13c482c89d03d8736693720c093b456a7df82b32a3c3c70d131

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page