Skip to main content

Fast Legendre-transform convex optimisation for energy-storage operation and spatial economic dispatch

Project description

FLToptim — Fast Legendre Transform Optim

Fast convex optimisation for energy-storage operation and spatial economic dispatch, built around the Legendre-transform dynamic program for convex piecewise-linear (and quadratic) value functions.

What's inside

  • cplfunction / cpqfunction — the convex piecewise-linear/quadratic value-function DP (OptimMargInt). Each function is stored as a map<position, slope-increment>, so the inf-convolutions of the Legendre / dynamic-programming recursion stay near-linear. This is the original dynprogstorage core (Girard, Barbesant, Foucault, Kariniotakis, 2013).
  • param_simplex — a bespoke parametric right-hand-side dual simplex that traces the exact injection-cost curve φ_n(y) of a small dense network LP in a single pass (one dual pivot per breakpoint), carrying its basis across hours.
  • elec / mr_decompose — the spatial-LP ↔ storage-DP decomposition for perfect-foresight annual dispatch: alternate a per-hour spatial network LP with the per-node storage DP, passing each node's convex injection-cost curve (not a scalar price) so the scheme is curvature-damped and converges to the monolithic optimum. Handles reservoirs, batteries (efficiency kink) and coupled multi-energy (electricity + hydrogen) networks, with optional parallelism (hour-chunk curve build; Jacobi across storages).

Install / build

pip install fltoptim          # from PyPI (builds from source on platforms without a wheel)
# or, from a checkout:
pip install -e .              # builds the Cython DP extension + the parametric-simplex shared library
# or
python setup.py build_ext --inplace

Building from source needs a C++17 compiler (Linux/macOS); numpy and highspy are the runtime dependencies. The reference frontal solves in the decomposition use Gurobi when available (optional).

The test suite ships with the package:

pip install "fltoptim[test]"
python -m pytest --pyargs FLToptim.tests -m "not slow" -q

Reference

R. Girard, V. Barbesant, F. Foucault, G. Kariniotakis, Fast dynamic programming with application to storage planning, 2013. Please cite it if you use this software (see CITATION.cff).

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

fltoptim-0.4.0.tar.gz (316.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fltoptim-0.4.0-cp313-cp313-macosx_12_0_arm64.whl (551.2 kB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

File details

Details for the file fltoptim-0.4.0.tar.gz.

File metadata

  • Download URL: fltoptim-0.4.0.tar.gz
  • Upload date:
  • Size: 316.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for fltoptim-0.4.0.tar.gz
Algorithm Hash digest
SHA256 7ab5a4cc7d89b1a250804fcfce8eac10d450b84b2b85193b0395a3eb906e2bc5
MD5 38f6f34510d9bb60d4fbb8973c1a3d96
BLAKE2b-256 8e6fb16424792d299382f6aed058392219526925fb19c433d74c9ec41794078c

See more details on using hashes here.

File details

Details for the file fltoptim-0.4.0-cp313-cp313-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for fltoptim-0.4.0-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 2ec0f9a970f79626b49351b98b25e4bca3d1ec58bc17b24d01143527b4832a00
MD5 6cf26cd0e2c92d46fe2b5ac760344a82
BLAKE2b-256 530ccabe7f2ce936ee1dec7534d6ce00fd936d20f5c050a111c04f81721db3fb

See more details on using hashes here.

Supported by

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