Custom Constraints
It's now possible to add custom constraints to the linear program.
The example below shows how to add a constraint on battery cycles:
import energypylinear as epl
import numpy as np
np.random.seed(42)
cycle_limit_mwh = 30
asset = epl.Battery(
power_mw=1,
capacity_mwh=2,
efficiency_pct=0.98,
electricity_prices=np.random.normal(0.0, 1000, 48 * 7),
constraints=[
epl.Constraint(
lhs=[
epl.ConstraintTerm(
asset_type="battery", variable="electric_charge_mwh"
),
epl.ConstraintTerm(
asset_type="battery", variable="electric_discharge_mwh"
),
],
rhs=cycle_limit,
sense="le",
interval_aggregation="sum",
)
],
)
Read more about custom constraints in the documentation.
Documentation Refactor
We have moved the asset validation documentation into the documentation for the assets.
A new section Customization
has been added to the documentation, which contains the documentation for custom constraints and objective functions.