energy-py-linear
Optimize energy assets using mixed-integer linear programming
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.3%) to scientific vocabulary
Keywords
Repository
Optimize energy assets using mixed-integer linear programming
Basic Info
Statistics
- Stars: 95
- Watchers: 5
- Forks: 30
- Open Issues: 3
- Releases: 9
Topics
Metadata Files
README.md
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 can be optimized to either maximize profit or minimize carbon emissions, or for user defined custom objective functions. Custom constraints can be used to further constrain asset behaviour.
A site is a collection of assets that can be optimized together. Sites can use custom objectives and constraints.
Energy balances are performed on electricity, high, and low temperature heat.
Setup
Requires Python 3.11 or 3.12:
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( powermw=2, capacitymwh=4, efficiencypct=0.9, # different electricity prices for each interval # length of electricityprices is the length of the simulation electricityprices=[100.0, 50, 200, -100, 0, 200, 100, -100], # a constant value for each interval exportelectricity_prices=40, )
simulation = asset.optimize() ```
Site API
The site API allows optimizing multiple assets together:
```python import energypylinear as epl
assets = [ # 2.0 MW, 4.0 MWh battery epl.Battery(powermw=2.0, capacitymwh=4.0), # 30 MW open cycle generator epl.CHP( electricpowermaxmw=100, electricpowerminmw=30, electricefficiencypct=0.4 ), # 2 EV chargers & 4 charge events epl.EVs( chargerspowermw=[100, 100], chargeeventscapacitymwh=[50, 100, 30, 40], chargeevents=[ [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, # length of energy prices is the length of the simulation electricityprices=[100, 50, 200, -100, 0], # these should match the length of the exportelectricityprices # if they don't, they will be repeated or cut to match the length of electricityprices hightemperatureloadmwh=[105, 110, 120, 110, 105], lowtemperatureloadmwh=[105, 110, 120, 110, 105], )
simulation = site.optimize() ```
Documentation
See more asset types & use cases in the documentation.
Test
shell
$ make test
Owner
- Name: Adam Green
- Login: ADGEfficiency
- Kind: user
- Website: adgefficiency.com
- Repositories: 78
- Profile: https://github.com/ADGEfficiency
GitHub Events
Total
- Watch event: 9
- Delete event: 2
- Issue comment event: 1
- Push event: 12
- Pull request event: 3
- Fork event: 1
- Create event: 1
Last Year
- Watch event: 9
- Delete event: 2
- Issue comment event: 1
- Push event: 12
- Pull request event: 3
- Fork event: 1
- Create event: 1
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Adam Green | a****n@a****m | 123 |
| Thomas Harvey | t****m@a****k | 21 |
| Sam | s****n@p****m | 5 |
| Ben Freke | b****e@g****m | 1 |
| Adam Green | u****u@i****l | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 22
- Total pull requests: 57
- Average time to close issues: 4 months
- Average time to close pull requests: 15 days
- Total issue authors: 11
- Total pull request authors: 5
- Average comments per issue: 2.45
- Average comments per pull request: 0.19
- Merged pull requests: 54
- Bot issues: 0
- Bot pull requests: 1
Past Year
- Issues: 2
- Pull requests: 5
- Average time to close issues: 2 days
- Average time to close pull requests: 2 months
- Issue authors: 2
- Pull request authors: 1
- Average comments per issue: 1.5
- Average comments per pull request: 0.8
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- tomharvey (8)
- rzylius (3)
- ADGEfficiency (2)
- oopam (2)
- peterdudfield (1)
- matteodefelice (1)
- lucas-vivier-cvegroup (1)
- ben-freke (1)
- corneels (1)
- andreasslyngstad (1)
- Minvyd (1)
Pull Request Authors
- ADGEfficiency (61)
- tomharvey (6)
- tonyfresko (1)
- ben-freke (1)
- dependabot[bot] (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- cairosvg *
- markdown-include *
- mike ==1.1.2
- mkdocs-material ==9.1.6
- mkdocstrings *
- phmdoctest *
- pillow *
- pytest *
- appnope 0.1.3 develop
- asttokens 2.2.1 develop
- attrs 23.1.0 develop
- backcall 0.2.0 develop
- beautifulsoup4 4.12.2 develop
- black 22.12.0 develop
- cffi 1.15.1 develop
- click 8.1.7 develop
- colorama 0.4.6 develop
- comm 0.1.4 develop
- coverage 6.5.0 develop
- coverage-badge 1.1.0 develop
- darglint 1.8.1 develop
- debugpy 1.6.7.post1 develop
- decorator 5.1.1 develop
- exceptiongroup 1.1.3 develop
- execnet 2.0.2 develop
- executing 1.2.0 develop
- fastjsonschema 2.18.0 develop
- flake8 6.1.0 develop
- flake8-docstring-checker 1.2 develop
- hypothesis 6.82.6 develop
- iniconfig 2.0.0 develop
- ipykernel 6.25.1 develop
- ipython 8.14.0 develop
- isort 5.12.0 develop
- jedi 0.19.0 develop
- jsonschema 4.19.0 develop
- jsonschema-specifications 2023.7.1 develop
- jupyter-client 8.3.0 develop
- jupyter-core 5.3.1 develop
- matplotlib-inline 0.1.6 develop
- mccabe 0.7.0 develop
- monotable 3.1.0 develop
- mypy 0.991 develop
- nbclient 0.6.8 develop
- nbformat 5.9.2 develop
- nbmake 1.4.3 develop
- nest-asyncio 1.5.7 develop
- parso 0.8.3 develop
- pathspec 0.11.2 develop
- pexpect 4.8.0 develop
- phmdoctest 1.4.0 develop
- pickleshare 0.7.5 develop
- platformdirs 3.10.0 develop
- pluggy 1.2.0 develop
- prompt-toolkit 3.0.39 develop
- psutil 5.9.5 develop
- ptyprocess 0.7.0 develop
- pure-eval 0.2.2 develop
- pycodestyle 2.11.0 develop
- pycparser 2.21 develop
- pyflakes 3.1.0 develop
- pytest 7.4.0 develop
- pytest-cov 4.1.0 develop
- pytest-sugar 0.9.7 develop
- pytest-xdist 3.3.1 develop
- pywin32 306 develop
- pyzmq 25.1.1 develop
- referencing 0.30.2 develop
- rpds-py 0.9.2 develop
- ruff 0.0.275 develop
- sortedcontainers 2.4.0 develop
- soupsieve 2.4.1 develop
- stack-data 0.6.2 develop
- termcolor 2.3.0 develop
- tornado 6.3.3 develop
- traitlets 5.9.0 develop
- wcwidth 0.2.6 develop
- commonmark 0.9.1
- contourpy 1.1.0
- cycler 0.11.0
- fonttools 4.42.1
- kiwisolver 1.4.5
- markdown 3.4.4
- markdown-include 0.8.1
- matplotlib 3.7.2
- multimethod 1.9.1
- mypy-extensions 1.0.0
- numpy 1.25.2
- packaging 23.1
- pandas 1.5.3
- pandera 0.14.5
- pillow 10.0.0
- pulp 2.7.0
- pydantic 1.10.12
- pygments 2.16.1
- pyparsing 3.0.9
- python-dateutil 2.8.2
- pytz 2023.3
- rich 12.6.0
- seaborn 0.12.2
- setuptools 68.1.2
- setuptools-scm 7.1.0
- six 1.16.0
- structlog 23.1.0
- tomli 2.0.1
- typing-extensions 4.7.1
- typing-inspect 0.9.0
- wrapt 1.15.0
- PuLP ^2.7.0
- markdown-include ^0.8.1
- matplotlib ^3.6.2
- numpy ^1.23.4
- pandas ^1.5.2
- pandera ^0.14.5
- pydantic ^1.10.2
- python ^3.10,<3.12
- rich ^12.0.0
- seaborn ^0.12.2
- structlog ^23.1.0