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.2.0.tar.gz (303.6 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.2.0-cp313-cp313-macosx_12_0_arm64.whl (516.1 kB view details)

Uploaded CPython 3.13macOS 12.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for fltoptim-0.2.0.tar.gz
Algorithm Hash digest
SHA256 de4b5454f49ce5a52edd7d2d2ada7f865025e8eb34c9f22528d3774c9408ae79
MD5 6de61aa55b7f228efd941e9cc1bc9642
BLAKE2b-256 5886f88129d375f6456cc81ae1044b4e0d5da707cdfc61333e0aab3f1b08d8f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fltoptim-0.2.0-cp313-cp313-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 ee2bffd644b28c12f2401d1fd1122dce152371917731c3c1a8b8574ef2a8a058
MD5 afa821001e8b0fbfe16ead4dad8c150a
BLAKE2b-256 0441f3db5dbee40db0e89e9fef0c029fbc1584be99cda4ff9eefc64d28c367ee

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