energypylinear


Nameenergypylinear JSON
Version 1.3.0 PyPI version JSON
download
home_page
SummaryOptimizing energy assets with mixed-integer linear programming.
upload_time2024-02-25 02:05:51
maintainer
docs_urlNone
authorAdam Green
requires_python>=3.10,<3.13
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # energy-py-linear

<img src="./static/coverage.svg"> [![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 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],
        ],
    ),
    #  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
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "energypylinear",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10,<3.13",
    "maintainer_email": "",
    "keywords": "",
    "author": "Adam Green",
    "author_email": "adam.green@adgefficiency.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/c3/c30935dbf1b687c1161374712d4dbcd6d23e3631a8c85f35f8ec292e1ff0/energypylinear-1.3.0.tar.gz",
    "platform": null,
    "description": "# energy-py-linear\n\n<img src=\"./static/coverage.svg\"> [![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 & power (CHP) generators,\n- electric vehicle smart charging,\n- heat pumps,\n- renewable (wind & solar) generators.\n\nAssets & sites can be optimized to either maximize profit or minimize carbon emissions, or a user defined custom objective function.\n\nEnergy balances are performed on electricity, high, and low temperature heat.\n\n## Setup\n\nRequires Python 3.10+:\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  electricity_prices=[100.0, 50, 200, -100, 0, 200, 100, -100],\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(\n        power_mw=2.0,\n        capacity_mwh=4.0\n    ),\n    #  30 MW open cycle generator\n    epl.CHP(\n        electric_power_max_mw=100,\n        electric_power_min_mw=30,\n        electric_efficiency_pct=0.4\n    ),\n    #  2 EV chargers & 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  electricity_prices=[100, 50, 200, -100, 0],\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 & use cases in the documentation](https://energypylinear.adgefficiency.com/latest).\n\n## Test\n\n```shell\n$ make test\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Optimizing energy assets with mixed-integer linear programming.",
    "version": "1.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "519055d90ca3d08928433e40f580a22ee9f490a7163a6a057724c147b1dcece8",
                "md5": "e3a8d1a3ea012a0342081593ef220b98",
                "sha256": "6520568e6aeb8f9f1ef7c82f95343299d8f03c2026d35aa7f164d55387d34661"
            },
            "downloads": -1,
            "filename": "energypylinear-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e3a8d1a3ea012a0342081593ef220b98",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10,<3.13",
            "size": 51223,
            "upload_time": "2024-02-25T02:05:49",
            "upload_time_iso_8601": "2024-02-25T02:05:49.237900Z",
            "url": "https://files.pythonhosted.org/packages/51/90/55d90ca3d08928433e40f580a22ee9f490a7163a6a057724c147b1dcece8/energypylinear-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0c3c30935dbf1b687c1161374712d4dbcd6d23e3631a8c85f35f8ec292e1ff0",
                "md5": "9688e3d441d3177b6c133346b4f64f29",
                "sha256": "e961a776f086a83b206e092161b04ca659e5d6c16d141e64404ab1eb5675995c"
            },
            "downloads": -1,
            "filename": "energypylinear-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9688e3d441d3177b6c133346b4f64f29",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10,<3.13",
            "size": 36693,
            "upload_time": "2024-02-25T02:05:51",
            "upload_time_iso_8601": "2024-02-25T02:05:51.543542Z",
            "url": "https://files.pythonhosted.org/packages/b0/c3/c30935dbf1b687c1161374712d4dbcd6d23e3631a8c85f35f8ec292e1ff0/energypylinear-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-25 02:05:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "energypylinear"
}
        
Elapsed time: 0.24595s