{"id":13721368,"url":"https://github.com/ADGEfficiency/energy-py-linear","last_synced_at":"2025-05-07T13:32:27.443Z","repository":{"id":40377770,"uuid":"165930138","full_name":"ADGEfficiency/energy-py-linear","owner":"ADGEfficiency","description":"Optimize energy assets using mixed-integer linear programming","archived":false,"fork":false,"pushed_at":"2025-03-30T09:36:42.000Z","size":5777,"stargazers_count":93,"open_issues_count":3,"forks_count":28,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-17T21:21:54.186Z","etag":null,"topics":["batteries","electric-vehicles","energy","optimization","python","renewable-energy","solar","wind"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ADGEfficiency.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-01-15T21:59:41.000Z","updated_at":"2025-03-25T14:00:36.000Z","dependencies_parsed_at":"2024-01-16T05:06:42.549Z","dependency_job_id":"9d798ff2-630d-4d40-a58b-87de5b8f1f70","html_url":"https://github.com/ADGEfficiency/energy-py-linear","commit_stats":{"total_commits":145,"total_committers":5,"mean_commits":29.0,"dds":"0.19310344827586212","last_synced_commit":"12adfa1a171b0a4b95bcf8d2d5f00a1030296762"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADGEfficiency%2Fenergy-py-linear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADGEfficiency%2Fenergy-py-linear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADGEfficiency%2Fenergy-py-linear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ADGEfficiency%2Fenergy-py-linear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ADGEfficiency","download_url":"https://codeload.github.com/ADGEfficiency/energy-py-linear/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250421883,"owners_count":21427850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batteries","electric-vehicles","energy","optimization","python","renewable-energy","solar","wind"],"created_at":"2024-08-03T01:01:16.129Z","updated_at":"2025-05-07T13:32:27.438Z","avatar_url":"https://github.com/ADGEfficiency.png","language":"Python","readme":"# energy-py-linear\n\n\u003cimg src=\"./static/coverage.svg\"\u003e [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n\n---\n\nDocumentation: [energypylinear.adgefficiency.com](https://energypylinear.adgefficiency.com/latest)\n\n---\n\nA Python library for optimizing energy assets with mixed-integer linear programming:\n\n- electric batteries,\n- combined heat \u0026 power (CHP) generators,\n- electric vehicle smart charging,\n- heat pumps,\n- renewable (wind \u0026 solar) generators.\n\nAssets 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.\n\nA site is a collection of assets that can be optimized together. Sites can use custom objectives and constraints.\n\nEnergy balances are performed on electricity, high, and low temperature heat.\n\n## Setup\n\nRequires Python 3.11 or 3.12:\n\n```shell-session\n$ pip install energypylinear\n```\n\n## Quick Start\n\n### Asset API\n\nThe asset API allows optimizing a single asset at once:\n\n```python\nimport energypylinear as epl\n\n#  2.0 MW, 4.0 MWh battery\nasset = epl.Battery(\n    power_mw=2,\n    capacity_mwh=4,\n    efficiency_pct=0.9,\n    # different electricity prices for each interval\n    # length of electricity_prices is the length of the simulation\n    electricity_prices=[100.0, 50, 200, -100, 0, 200, 100, -100],\n    # a constant value for each interval\n    export_electricity_prices=40,\n)\n\nsimulation = asset.optimize()\n```\n\n### Site API\n\nThe site API allows optimizing multiple assets together:\n\n```python\nimport energypylinear as epl\n\nassets = [\n    #  2.0 MW, 4.0 MWh battery\n    epl.Battery(power_mw=2.0, capacity_mwh=4.0),\n    #  30 MW open cycle generator\n    epl.CHP(\n        electric_power_max_mw=100, electric_power_min_mw=30, electric_efficiency_pct=0.4\n    ),\n    #  2 EV chargers \u0026 4 charge events\n    epl.EVs(\n        chargers_power_mw=[100, 100],\n        charge_events_capacity_mwh=[50, 100, 30, 40],\n        charge_events=[\n            [1, 0, 0, 0, 0],\n            [0, 1, 1, 1, 0],\n            [0, 0, 0, 1, 1],\n            [0, 1, 0, 0, 0],\n        ],\n    ),\n    #  natural gas boiler to generate high temperature heat\n    epl.Boiler(),\n    #  valve to generate low temperature heat from high temperature heat\n    epl.Valve(),\n]\n\nsite = epl.Site(\n    assets=assets,\n    # length of energy prices is the length of the simulation\n    electricity_prices=[100, 50, 200, -100, 0],\n    # these should match the length of the export_electricity_prices\n    # if they don't, they will be repeated or cut to match the length of electricity_prices\n    high_temperature_load_mwh=[105, 110, 120, 110, 105],\n    low_temperature_load_mwh=[105, 110, 120, 110, 105],\n)\n\nsimulation = site.optimize()\n```\n\n## Documentation\n\n[See more asset types \u0026 use cases in the documentation](https://energypylinear.adgefficiency.com/latest).\n\n## Test\n\n```shell\n$ make test\n```\n","funding_links":[],"categories":["Energy Systems"],"sub_categories":["Energy System Modeling Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FADGEfficiency%2Fenergy-py-linear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FADGEfficiency%2Fenergy-py-linear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FADGEfficiency%2Fenergy-py-linear/lists"}