Storages have one incoming and one outgoing Flow with a charging and discharging efficiency.
A storage has a state of charge size
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
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
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$
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:
- Bounds with State - Investment decisions (see InvestParameters)
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.
- Flow - Input and output flow definitions
- InvestParameters - Variable storage sizing
- Modeling Patterns - Mathematical building blocks