Skip to content

Commit 4eb34da

Browse files
committed
feat
1 parent 85af22b commit 4eb34da

File tree

6 files changed

+97
-8
lines changed

6 files changed

+97
-8
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ asset = epl.Battery(
4444
power_mw=2,
4545
capacity_mwh=4,
4646
efficiency_pct=0.9,
47-
# different electricity prices for each interval
48-
# length of electricity_prices is the length of the simulation
4947
electricity_prices=[100.0, 50, 200, -100, 0, 200, 100, -100],
50-
# a constant value for each interval
5148
export_electricity_prices=40,
5249
)
5350

docs/docs/examples/renewable-battery-export.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example of a site with a renewable generator and a battery exporting to the grid."""
2+
23
import energypylinear as epl
34

45
assets = [

docs/docs/how-to/battery-degradation.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
Battery degradation is where battery performance reduces with time or battery use.
1+
Battery performance reducing is known as battery degradation. Battery degradation can occur over time or with battery use.
22

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

5-
`energypylinear` does not model battery degradation within a single simulation - degradation can be handled by splitting up the battery lifetime into multiple simulations.
5+
`energypylinear` does not model battery degradation within a single simulation. Parameters like capacity or efficiency are held constant across a simulation.
6+
7+
Degradation can be handled by splitting up the battery lifetime into multiple simulations, with different parameters used in different simulations.
68

79
## Modelling a Single Year in Monthly Chunks
810

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Renewable Generator, Battery and Site Limits
2+
3+
`energypylinear` has the ability to optimize a battery located with renewable electricity generation.
4+
5+
This guide shows how to model a site with a renewable generator and battery that can export electricity to the grid.
6+
7+
## Basic Setup
8+
9+
First, let's set up a site with two assets - a solar generator and battery, with a site export limit of 25 MW:
10+
11+
<!--phmdoctest-share-names-->
12+
```python
13+
import energypylinear as epl
14+
15+
# Create assets:
16+
# - 10 MW / 20 MWh battery with 90% round-trip efficiency
17+
# - Solar generator with a predefined generation profile (10-30 MW across 5 intervals)
18+
# - Generator can be curtailed down to 50% of available generation
19+
# - Custom name "solar" for the generator
20+
assets = [
21+
epl.Battery(power_mw=10, capacity_mwh=20, efficiency_pct=0.9),
22+
epl.RenewableGenerator(
23+
electric_generation_mwh=[10, 20, 30, 20, 10],
24+
electric_generation_lower_bound_pct=0.5,
25+
name="solar",
26+
),
27+
]
28+
29+
# Configure site:
30+
# - Carbon intensity values for each interval (negative values represent low carbon periods)
31+
# - Maximum export limit of 25 MW to the grid
32+
site = epl.Site(
33+
assets=assets,
34+
electricity_carbon_intensities=[0.5, -0.5, 0.5, 0.5, -0.5],
35+
export_limit_mw=25,
36+
)
37+
38+
# Optimize for carbon minimization rather than profit maximization
39+
simulation = site.optimize(objective="carbon")
40+
```
41+
42+
## Examining the Results
43+
44+
Let's examine the results of our optimization to see how the battery and solar plant work together under carbon optimization.
45+
46+
<!--phmdoctest-share-names-->
47+
```python
48+
print(
49+
simulation.results[
50+
[
51+
"site-electricity_carbon_intensities",
52+
"site-export_limit_mw",
53+
"site-export_power_mwh",
54+
"solar-electric_generation_used_mwh",
55+
"battery-electric_charge_mwh",
56+
"battery-electric_discharge_mwh",
57+
"battery-electric_final_charge_mwh",
58+
]
59+
]
60+
)
61+
```
62+
63+
This gives us the following output:
64+
65+
```
66+
site-electricity_carbon_intensities site-export_limit_mw site-export_power_mwh solar-electric_generation_used_mwh battery-electric_charge_mwh battery-electric_discharge_mwh battery-electric_final_charge_mwh
67+
0 0.5 25 10.00 10.0 0.00 0.00 0.00
68+
1 -0.5 25 25.00 20.0 5.00 0.00 4.50
69+
2 0.5 25 25.00 30.0 0.00 5.00 0.00
70+
3 0.5 25 15.00 20.0 0.00 5.00 0.00
71+
4 -0.5 25 10.00 10.0 0.00 0.00 0.00
72+
```
73+
74+
## Results Interpretation
75+
76+
When optimized for carbon, we can observe the following behavior:
77+
78+
1. During periods with negative carbon intensity (intervals 1 and 4):
79+
- In interval 1: The battery charges 5 MWh while solar generates 20 MWh, maximizing export to the grid up to the 25 MW limit
80+
- In interval 4: Solar generation is only 10 MWh, which is fully exported
81+
82+
2. During periods with positive carbon intensity (intervals 0, 2, and 3):
83+
- The battery discharges in intervals 2 and 3 to maximize export during high carbon periods
84+
- The battery and solar work together to respect the 25 MW export limit
85+
86+
This strategy minimizes overall carbon emissions by:
87+
- Maximizing export during negative carbon periods (displacing high-carbon grid generation)
88+
- Using the battery to shift energy between periods strategically

docs/mkdocs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ nav:
6565
- Multiple Assets: how-to/dispatch-site.md
6666
- Carbon: how-to/price-carbon.md
6767
- Forecast: how-to/dispatch-forecast.md
68-
- Battery Cycles: how-to/battery-cycles.md
68+
- Battery Degradation: how-to/battery-degradation.md
6969
- Network Charges: how-to/network-charges.md
70-
>>>>>>> 8a21d117db6b142efd9f1d9f0dd4e87d5a7dae35
70+
- Renewables, Battery and Site Limits: how-to/renewables-and-battery.md
7171
- Customization:
7272
- Constraints: how-to/custom-constraints.md
7373
- Objective Functions: how-to/custom-objectives.md

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ cairosvg
88
mike==1.1.2
99
material-plausible-plugin
1010
pymdown-extensions
11+
setuptools

0 commit comments

Comments
 (0)