Flow¶
A Flow is the primary optimization variable — the solver decides how much flows at each timestep.
Basic: Bounded Flow Rate¶
Every flow has a size \(P\) (capacity) and a flow rate \(p(t)\) (what the solver optimizes):
\[ P \cdot p_{rel}^{min} \leq p(t) \leq P \cdot p_{rel}^{max} \]
# 100 kW boiler, minimum 30% when running
heat = fx.Flow(label='heat', bus=heat_bus, size=100, relative_minimum=0.3)
# → 30 ≤ p(t) ≤ 100
Cannot be zero
With relative_minimum > 0, the flow cannot be zero. Use status_parameters to allow shutdown.
Adding Features¶
Allow the flow to be zero with status_parameters:
\(s(t) \cdot P \cdot p_{rel}^{min} \leq p(t) \leq s(t) \cdot P \cdot p_{rel}^{max}\)
Where \(s(t) \in \{0, 1\}\): inactive or active.
generator = fx.Flow(
label='power', bus=elec_bus, size=50,
relative_minimum=0.4,
status_parameters=fx.StatusParameters(
effects_per_startup={'costs': 500},
min_uptime=2,
),
)
See StatusParameters.
Optimize the capacity with InvestParameters:
\(P^{min} \leq P \leq P^{max}\)
battery = fx.Flow(
label='power', bus=elec_bus,
size=fx.InvestParameters(
minimum_size=0,
maximum_size=1000,
specific_effects={'costs': 100_000},
),
)
See InvestParameters.
Add effects per energy (flow hours) moved:
Flow hours: \(h(t) = p(t) \cdot \Delta t\)
Optional Constraints¶
Reference¶
| Symbol | Type | Description |
|---|---|---|
| \(p(t)\) | \(\mathbb{R}_{\geq 0}\) | Flow rate at timestep \(t\) |
| \(P\) | \(\mathbb{R}_{\geq 0}\) | Size (capacity) — fixed or optimized |
| \(s(t)\) | \(\{0, 1\}\) | Binary status (with status_parameters) |
| \(p_{rel}^{min}\) | \(\mathbb{R}_{\geq 0}\) | Minimum relative flow (relative_minimum) |
| \(p_{rel}^{max}\) | \(\mathbb{R}_{\geq 0}\) | Maximum relative flow (relative_maximum) |
| \(\pi(t)\) | \(\mathbb{R}_{\geq 0}\) | Fixed profile (fixed_relative_profile) |
| \(\Delta t\) | \(\mathbb{R}_{> 0}\) | Timestep duration (hours) |