Skip to main content

pyCIAP

CodeFactor Grade

This a very simple package to solve the Combinatorial Integral Approximation Problem (CIAP) including dwell-time constraints by a dwell-time sum-up rounding algorithm, see 1 for the theoretical results.

Install

Clone this repo and then run

python3 setup.py install

inside the repo directory.

Example:

from pyCIAP import DSUR, solveCIAPMDT
import numpy as np

# Relaxed control fulfilling SOS1-constraint
b_rel = np.array([[
    0.47131227, 0.78736104, 0.97325193, 0.53496864, 
    0.73187786, 0.07838749, 0.48948843, 0.64580892],
    [0.52868773, 0.21263896, 0.02674807, 0.46503136, 
    0.26812214, 0.92161251, 0.51051157, 0.35419108]])

# time grid
dt = 1.0
time = np.arange(0, b_rel.shape[1], dt)

# Computes a binary control fulfilling the minimum dwell times
# The dwell times are always in number of time steps, i.e. multiples of dt
b_bin = DSUR(b_rel, 1.0, time, min_up_time=3, min_down_time=3)

gives

array([[1, 1, 1, 0, 0, 0, 1, 1],
       [0, 0, 0, 1, 1, 1, 0, 0]])

In order to compare the DSUR solution to the global optimum, one can solve the CIAP by Gurobi and use the solution as MIP start:

runtime, eps_opt, eps_dsur = solveCIAPMDT(b_rel, dt, 3, 3, start_sol=b_bin)

Here eps_opt and eps_dsur denote the objective values of the corresponding CIAP, i.e. the integrality gap.

Metadata

Release files for pyCIAP 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pyCIAP 0.0.2
File Interpreter ABI Platform
pyCIAP-0.0.2-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
pyCIAP-0.0.2-cp39-cp39-macosx_10_15_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.15+ x86-64 Details

Total release size: 345.1 kB

Release files / pyCIAP-0.0.2-cp39-cp39-win_amd64.whl

Download URL pyCIAP-0.0.2-cp39-cp39-win_amd64.whl
Size 257.9 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
4cce8d33158465f396c2e9366691ee6d2a6bf6398b5ee78f46902e4248509859
BLAKE2b-256 checksum
How to use checksums
5b832580197d7aa70568ba4d7295d3b0a2856b23a44acd64840025779d57f441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release files / pyCIAP-0.0.2-cp39-cp39-macosx_10_15_x86_64.whl

Download URL pyCIAP-0.0.2-cp39-cp39-macosx_10_15_x86_64.whl
Size 87.2 kB
Tags CPython 3.9 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
d69d1af15afd562c00a4f2863d6f8d4b2dbbdc93059225d1c2dd03cd27a1c905
BLAKE2b-256 checksum
How to use checksums
6d02fff45e77cc062f86e1f107ae1d870129f7fbb08cd002f1aa27378ea95d02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/0.0.8 requests/2.25.1 setuptools/57.4.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page