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.5.0.tar.gz (320.4 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.5.0-cp313-cp313-macosx_26_0_arm64.whl (559.3 kB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for fltoptim-0.5.0.tar.gz
Algorithm Hash digest
SHA256 9a169d6ce8bd49bcb14fbec4c08a3389728169c6c953ec69e6dc91eb4b7fdb64
MD5 fec3c933260a34ccfebdd7b1f412663c
BLAKE2b-256 77c5965661de6724439e2cb5ee71eaf7af3919e21c21750744d2dffa6351ebb8

See more details on using hashes here.

File details

Details for the file fltoptim-0.5.0-cp313-cp313-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for fltoptim-0.5.0-cp313-cp313-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 3e6bdde0fc231ca95d8b68b4d1d5876845515e25013005a71fa646f49e913890
MD5 097cbe7db88e71029afeaa257b7fc55d
BLAKE2b-256 b7eb88c8fa2f6e980d59a0af3d9932fb8ebe83e984247593be3ca5c5028c4769

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