Skip to content

Latest commit

 

History

History
79 lines (57 loc) · 3.59 KB

File metadata and controls

79 lines (57 loc) · 3.59 KB

Storages

Storages have one incoming and one outgoing Flow with a charging and discharging efficiency. A storage has a state of charge $c(\text{t}_i)$ which is limited by its size $\text C$ and relative bounds $\eqref{eq:Storage_Bounds}$.

$$ \label{eq:Storage_Bounds} \text C \cdot \text c^{\text{L}}_{\text{rel}}(\text t_{i}) \leq c(\text{t}_i) \leq \text C \cdot \text c^{\text{U}}_{\text{rel}}(\text t_{i}) $$

Where:

  • $\text C$ is the size of the storage
  • $c(\text{t}_i)$ is the state of charge at time $\text{t}_i$
  • $\text c^{\text{L}}{\text{rel}}(\text t{i})$ is the relative lower bound (typically 0)
  • $\text c^{\text{U}}{\text{rel}}(\text t{i})$ is the relative upper bound (typically 1)

With $\text c^{\text{L}}{\text{rel}}(\text t{i}) = 0$ and $\text c^{\text{U}}{\text{rel}}(\text t{i}) = 1$, Equation $\eqref{eq:Storage_Bounds}$ simplifies to

$$ 0 \leq c(\text t_{i}) \leq \text C $$

The state of charge $c(\text{t}i)$ decreases by a fraction of the prior state of charge. The belonging parameter $ \dot{ \text c}\text{rel, loss}(\text{t}_i)$ expresses the "loss fraction per hour". The storage balance from $\text{t}i$ to $\text t{i+1}$ is

$$ \begin{align*} c(\text{t}_{i+1}) &= c(\text{t}_{i}) \cdot (1-\dot{\text{c}}_\text{rel,loss}(\text{t}_i))^{\Delta \text{t}_{i}} \\ &\quad + p_{f_\text{in}}(\text{t}_i) \cdot \Delta \text{t}_i \cdot \eta_\text{in}(\text{t}_i) \\ &\quad - p_{f_\text{out}}(\text{t}_i) \cdot \Delta \text{t}_i \cdot \eta_\text{out}(\text{t}_i) \tag{3} \end{align*} $$

Where:

  • $c(\text{t}{i+1})$ is the state of charge at time $\text{t}{i+1}$
  • $c(\text{t}{i})$ is the state of charge at time $\text{t}{i}$
  • $\dot{\text{c}}_\text{rel,loss}(\text{t}_i)$ is the relative loss rate (self-discharge) per hour
  • $\Delta \text{t}_{i}$ is the time step duration in hours
  • $p_{f_\text{in}}(\text{t}_i)$ is the input flow rate at time $\text{t}_i$
  • $\eta_\text{in}(\text{t}_i)$ is the charging efficiency at time $\text{t}_i$
  • $p_{f_\text{out}}(\text{t}_i)$ is the output flow rate at time $\text{t}_i$
  • $\eta_\text{out}(\text{t}_i)$ is the discharging efficiency at time $\text{t}_i$

Mathematical Patterns Used

Storage formulation uses the following modeling patterns:

  • Basic Bounds - For charge state bounds (equation $\eqref{eq:Storage_Bounds}$)
  • Scaled Bounds - For flow rate bounds relative to storage size

When combined with investment parameters, storage can use:


Implementation

Python Class: [Storage][flixopt.components.Storage]

Key Parameters:

  • capacity_in_flow_hours: Storage capacity $\text{C}$
  • relative_loss_per_hour: Self-discharge rate $\dot{\text{c}}_\text{rel,loss}$
  • initial_charge_state: Initial charge $c(\text{t}_0)$
  • minimal_final_charge_state, maximal_final_charge_state: Final charge bounds $c(\text{t}_\text{end})$ (optional)
  • eta_charge, eta_discharge: Charging/discharging efficiencies $\eta_\text{in}, \eta_\text{out}$

See the [Storage][flixopt.components.Storage] API documentation for complete parameter list and usage examples.


See Also