Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ADGEfficiency/energy-py-linear
Optimize energy assets using mixed-integer linear programming
https://github.com/ADGEfficiency/energy-py-linear
batteries electric-vehicles energy optimization python renewable-energy solar wind
Last synced: 3 months ago
JSON representation
Optimize energy assets using mixed-integer linear programming
- Host: GitHub
- URL: https://github.com/ADGEfficiency/energy-py-linear
- Owner: ADGEfficiency
- License: gpl-3.0
- Created: 2019-01-15T21:59:41.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-06-09T04:15:31.000Z (5 months ago)
- Last Synced: 2024-06-11T17:45:38.350Z (5 months ago)
- Topics: batteries, electric-vehicles, energy, optimization, python, renewable-energy, solar, wind
- Language: Python
- Homepage:
- Size: 4.47 MB
- Stars: 79
- Watchers: 5
- Forks: 26
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- open-sustainable-technology - energy-py-linear - Optimizing energy systems using mixed integer linear programming. (Energy Systems / Energy System Modeling Frameworks)
README
# energy-py-linear
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
---
Documentation: [energypylinear.adgefficiency.com](https://energypylinear.adgefficiency.com/latest)
---
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, or a user defined custom objective function.
Energy balances are performed on electricity, high, and low temperature heat.
## Setup
Requires Python 3.10+:
```shell-session
$ pip install energypylinear
```## Quick Start
### Asset API
The asset API allows optimizing a single asset at once:
```python
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],
export_electricity_prices=40
)simulation = asset.optimize()
```### Site API
The site API allows optimizing multiple assets together:
```python
import energypylinear as eplassets = [
# 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],
],
),
# natural gas boiler to generate high temperature heat
epl.Boiler(),
# valve to generate low temperature heat from high temperature heat
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](https://energypylinear.adgefficiency.com/latest).
## Test
```shell
$ make test
```