Optimizing energy assets with mixed-integer linear programming.
Project description
energy-py-linear
Documentation: energypylinear.adgefficiency.com
A Python library for optimizing energy assets with mixed-integer linear programming:
- electric batteries,
- combined heat & power (CHP) generators,
- electric vehicle smart charging,
- heat pumps,
- renewable (wind & solar) generators.
Assets & sites can be optimized to either maximize profit or minimize carbon emissions.
Energy balances are performed on electricity, high & low temperature heat.
Setup
Requires Python 3.10+:
$ pip install energypylinear
Quick Start
Asset API
The asset API allows optimizing a single asset at once:
import energypylinear as epl
# 2.0 MW, 4.0 MWh battery
asset = epl.Battery(
power_mw=2,
capacity_mwh=4,
efficiency_pct=0.9,
electricity_prices=[100.0, 50, 200, -100, 0, 200, 100, -100]
)
simulation = asset.optimize()
Site API
The site API allows optimizing multiple assets together:
import energypylinear as epl
assets = [
# 2.0 MW, 4.0 MWh battery
epl.Battery(
power_mw=2.0,
capacity_mwh=4.0
),
# 30 MW open cycle generator
epl.CHP(
electric_power_max_mw=100,
electric_power_min_mw=30,
electric_efficiency_pct=0.4
),
# 2 EV chargers & 4 charge events
epl.EVs(
chargers_power_mw=[100, 100],
charge_events_capacity_mwh=[50, 100, 30, 40],
charge_events=[
[1, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[0, 0, 0, 1, 1],
[0, 1, 0, 0, 0],
],
),
epl.Boiler(),
epl.Valve()
]
site = epl.Site(
assets=assets,
electricity_prices=[100, 50, 200, -100, 0],
high_temperature_load_mwh=[105, 110, 120, 110, 105],
low_temperature_load_mwh=[105, 110, 120, 110, 105]
)
simulation = site.optimize()
Documentation
See more asset types & use cases in the documentation.
Test
$ make test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
energypylinear-1.0.0.tar.gz
(31.3 kB
view hashes)
Built Distribution
Close
Hashes for energypylinear-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 035daefb380d96d0c504491ab3a477e8f0e2c3ad88f5cd00bdf0a5a3bbd5ea58 |
|
MD5 | df962e725b4f9c8aa973cde3ea90b4ad |
|
BLAKE2b-256 | d2110dd0b36e6269745886f5b71bf65d82bcc2ebd26166377eb7c17e4f22cfed |