Storage¶
A Storage accumulates energy over time — charge now, discharge later.
Basic: Charge Dynamics¶
\[ c(t+1) = c(t) \cdot (1 - \dot{c}_{loss})^{\Delta t} + p_{in}(t) \cdot \Delta t \cdot \eta_{in} - p_{out}(t) \cdot \Delta t / \eta_{out} \]
battery = fx.Storage(
label='battery',
charging=fx.Flow(label='charge', bus=elec_bus, size=50),
discharging=fx.Flow(label='discharge', bus=elec_bus, size=50),
capacity_in_flow_hours=200, # 200 kWh
eta_charge=0.95,
eta_discharge=0.95,
)
# Round-trip efficiency: 95% × 95% = 90.25%
Charge State Bounds¶
\[ C \cdot c_{rel}^{min} \leq c(t) \leq C \cdot c_{rel}^{max} \]
fx.Storage(...,
relative_minimum_charge_state=0.2, # Min 20% SOC
relative_maximum_charge_state=0.8, # Max 80% SOC
)
Initial & Final Conditions¶
Adding Features¶
Optimize storage size:
Reference¶
| Symbol | Type | Description |
|---|---|---|
| \(c(t)\) | \(\mathbb{R}_{\geq 0}\) | Charge state at timestep \(t\) |
| \(C\) | \(\mathbb{R}_{\geq 0}\) | Capacity (capacity_in_flow_hours) |
| \(p_{in}(t)\) | \(\mathbb{R}_{\geq 0}\) | Charging power (from charging flow) |
| \(p_{out}(t)\) | \(\mathbb{R}_{\geq 0}\) | Discharging power (from discharging flow) |
| \(\eta_{in}\) | \(\mathbb{R}_{\geq 0}\) | Charge efficiency (eta_charge) |
| \(\eta_{out}\) | \(\mathbb{R}_{\geq 0}\) | Discharge efficiency (eta_discharge) |
| \(\dot{c}_{loss}\) | \(\mathbb{R}_{\geq 0}\) | Self-discharge rate (relative_loss_per_hour) |
| \(c_{rel}^{min}\) | \(\mathbb{R}_{\geq 0}\) | Min charge state (relative_minimum_charge_state) |
| \(c_{rel}^{max}\) | \(\mathbb{R}_{\geq 0}\) | Max charge state (relative_maximum_charge_state) |
| \(\Delta t\) | \(\mathbb{R}_{> 0}\) | Timestep duration (hours) |
Classes: Storage, StorageModel