energypylinear


Nameenergypylinear JSON
Version 1.4.0 PyPI version JSON
download
home_pageNone
SummaryOptimizing energy assets with mixed-integer linear programming.
upload_time2024-06-22 02:31:18
maintainerNone
docs_urlNone
authorAdam Green
requires_python<3.13,>=3.10
licenseGNU GPLv3
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": null,
    "name": "energypylinear",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Adam Green",
    "author_email": "adam.green@adgefficiency.com",
    "download_url": "https://files.pythonhosted.org/packages/f0/52/ed388ec4541f36d1d7896e64be1c21d81efeaa2eb331ab0890a86498f4e6/energypylinear-1.4.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": "GNU GPLv3",
    "summary": "Optimizing energy assets with mixed-integer linear programming.",
    "version": "1.4.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c08427b8c437613c6088394e116bd4289f50679e873c72556e314e76b43021b9",
                "md5": "5d7653773b20e72d18e73f91379f60cf",
                "sha256": "65650e1f5ae83f62b8d481dde51c5244c9fca428492cffd657cb6aa8367bc03b"
            },
            "downloads": -1,
            "filename": "energypylinear-1.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d7653773b20e72d18e73f91379f60cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 66531,
            "upload_time": "2024-06-22T02:31:16",
            "upload_time_iso_8601": "2024-06-22T02:31:16.194560Z",
            "url": "https://files.pythonhosted.org/packages/c0/84/27b8c437613c6088394e116bd4289f50679e873c72556e314e76b43021b9/energypylinear-1.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f052ed388ec4541f36d1d7896e64be1c21d81efeaa2eb331ab0890a86498f4e6",
                "md5": "6bd69a564cb09508840d4f397b4fb2f9",
                "sha256": "b817259dec07b06091dd03b7ad28617fe4beb718fa693e9d8d3dd55ebd4f6841"
            },
            "downloads": -1,
            "filename": "energypylinear-1.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6bd69a564cb09508840d4f397b4fb2f9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 51148,
            "upload_time": "2024-06-22T02:31:18",
            "upload_time_iso_8601": "2024-06-22T02:31:18.031262Z",
            "url": "https://files.pythonhosted.org/packages/f0/52/ed388ec4541f36d1d7896e64be1c21d81efeaa2eb331ab0890a86498f4e6/energypylinear-1.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-22 02:31:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "energypylinear"
}
        
Elapsed time: 0.29090s