Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/examples/renewable-battery-export.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Example of a site with a renewable generator and a battery exporting to the grid."""

import energypylinear as epl

assets = [
Expand Down
8 changes: 5 additions & 3 deletions docs/docs/how-to/battery-degradation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Battery degradation is where battery performance reduces with time or battery use.
Battery performance reducing is known as battery degradation. Battery degradation can occur over time or with battery use.

The performance of the battery is defined by the parameters of power (MW), capacity (MWh) and efficiency (%).
The performance of a battery is defined by the parameters of power (MW), capacity (MWh) and efficiency (%).

`energypylinear` does not model battery degradation within a single simulation - degradation can be handled by splitting up the battery lifetime into multiple simulations.
`energypylinear` does not model battery degradation within a single simulation. Parameters like capacity or efficiency are held constant across a simulation.

Degradation can be handled by splitting up the battery lifetime into multiple simulations, with different parameters used in different simulations.

## Modelling a Single Year in Monthly Chunks

Expand Down
38 changes: 38 additions & 0 deletions docs/docs/how-to/renewables-and-battery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Renewable Generator, Battery and Site Limits

`energypylinear` has the ability to optimize a battery located with renewable electricity generation.

This example shows how to model a site with a renewable generator and battery that can export electricity to the grid.

First, let's set up a site with two assets - a solar generator and battery, with a site export limit of 25 MW:

<!--phmdoctest-share-names-->
```python
import energypylinear as epl

# Create assets:
# - 10 MW / 20 MWh battery with 90% round-trip efficiency
# - Solar generator with a predefined generation profile (10-30 MW across 5 intervals)
# - Generator can be curtailed down to 50% of available generation
# - Custom name "solar" for the generator
assets = [
epl.Battery(power_mw=10, capacity_mwh=20, efficiency_pct=0.9),
epl.RenewableGenerator(
electric_generation_mwh=[10, 20, 30, 20, 10],
electric_generation_lower_bound_pct=0.5,
name="solar",
),
]

# Configure site:
# - Carbon intensity values for each interval (negative values represent low carbon periods)
# - Maximum export limit of 25 MW to the grid
site = epl.Site(
assets=assets,
electricity_carbon_intensities=[0.5, -0.5, 0.5, 0.5, -0.5],
export_limit_mw=25,
)

# Optimize for carbon minimization rather than profit maximization
simulation = site.optimize(objective="carbon")
```
4 changes: 2 additions & 2 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ nav:
- Multiple Assets: how-to/dispatch-site.md
- Carbon: how-to/price-carbon.md
- Forecast: how-to/dispatch-forecast.md
- Battery Cycles: how-to/battery-cycles.md
- Battery Degradation: how-to/battery-degradation.md
- Network Charges: how-to/network-charges.md
>>>>>>> 8a21d117db6b142efd9f1d9f0dd4e87d5a7dae35
- Renewables, Battery and Site Limits: how-to/renewables-and-battery.md
- Customization:
- Constraints: how-to/custom-constraints.md
- Objective Functions: how-to/custom-objectives.md
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ cairosvg
mike==1.1.2
material-plausible-plugin
pymdown-extensions
setuptools
2 changes: 1 addition & 1 deletion energypylinear/assets/renewable_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RenewableGeneratorIntervalData(pydantic.BaseModel):
"""Renewable Generator interval data."""

electric_generation_mwh: np.ndarray | list[float] | float
idx: list[int] | np.ndarray = pydantic.Field(default_factory=list)
idx: list[int] | np.ndarray = pydantic.Field(default_factory=lambda: [])
model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)

@pydantic.field_validator("electric_generation_mwh", mode="after")
Expand Down
2,250 changes: 1,088 additions & 1,162 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pandas = "^2.0"
matplotlib = "^3.6.2"
rich = "^12.0.0"
seaborn = "^0.12.2"
pandera = "^0.14.5"
pandera = "^0.23"
markdown-include = "^0.8.1"

[tool.poetry.group.check]
Expand Down