From d43c1ba646c13b43324fc0cd2cbe02fffae315ad Mon Sep 17 00:00:00 2001 From: Diego Alejandro Tejada Arango <12887482+datejada@users.noreply.github.com> Date: Fri, 29 Mar 2024 14:44:41 +0100 Subject: [PATCH] Update mathematical fomulation (#573) --- docs/src/features.md | 102 +++++++++---------- docs/src/formulation.md | 216 +++++++++++++++++++++++++++------------- 2 files changed, 198 insertions(+), 120 deletions(-) diff --git a/docs/src/features.md b/docs/src/features.md index bdefd06c..69dd4b75 100644 --- a/docs/src/features.md +++ b/docs/src/features.md @@ -151,9 +151,9 @@ As shown in the table, the resolution of the storage balance is energy, which is ```math \begin{aligned} -& storage\_balance_{phs,1:6}: \\ -& \qquad storage\_level_{phs,1:6} = 3 \cdot p^{eff}_{(wind,phs)} \cdot flow_{(wind,phs),1:3} + 3 \cdot p^{eff}_{(wind,phs)} \cdot flow_{(wind,phs),4:6} \\ -& \qquad \quad - \frac{4}{p^{eff}_{(phs,balance)}} \cdot flow_{(phs,balance),1:4} - \frac{2}{p^{eff}_{(phs,balance)}} \cdot flow_{(phs,balance),5:6} \\ +& \text{storage\_balance}_{\text{phs},1:6}: \\ +& \qquad v^{\text{intra-storage}}_{\text{phs},1:6} = 3 \cdot p^{\text{eff}}_{(\text{wind},\text{phs})} \cdot v^{\text{flow}}_{(\text{wind},\text{phs}),1:3} + 3 \cdot p^{\text{eff}}_{(\text{wind},\text{phs})} \cdot v^{\text{flow}}_{(\text{wind},\text{phs}),4:6} \\ +& \qquad \quad - \frac{4}{p^{\text{eff}}_{(\text{phs},\text{balance})}} \cdot v^{\text{flow}}_{(\text{phs},\text{balance}),1:4} - \frac{2}{p^{\text{eff}}_{(\text{phs},\text{balance})}} \cdot v^{\text{flow}}_{(\text{phs},\text{balance}),5:6} \\ \end{aligned} ``` @@ -163,10 +163,10 @@ The flows coming from the balancing hub are defined every three hours. Therefore ```math \begin{aligned} -& consumer\_balance_{demand,1:3}: \\ -& \qquad flow_{(balance,demand),1:3} = p^{peak\_demand}_{demand} \cdot \frac{\sum_{k=1}^{3} p^{profile}_{demand,k}}{3} \\ -& consumer\_balance_{demand,4:6}: \\ -& \qquad flow_{(balance,demand),4:6} = p^{peak\_demand}_{demand} \cdot \frac{\sum_{k=4}^{6} p^{profile}_{demand,k}}{3} \\ +& \text{consumer\_balance}_{\text{demand},1:3}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} = p^{\text{peak demand}}_{\text{demand}} \cdot \frac{\sum_{b=1}^{3} p^{\text{demand profile}}_{\text{demand},b}}{3} \\ +& \text{consumer\_balance}_{\text{demand},4:6}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} = p^{\text{peak demand}}_{\text{demand}} \cdot \frac{\sum_{b=4}^{6} p^{\text{demand profile}}_{\text{demand},b}}{3} \\ \end{aligned} ``` @@ -176,19 +176,18 @@ The hub balance is quite interesting because it integrates several flow resoluti ```math \begin{aligned} -& hub\_balance_{balance,1:1}: \\ -& \qquad flow_{(balance,demand),1:3} = flow_{(ccgt,balance), 1:1} + flow_{(wind,balance),1:2} + flow_{(phs,balance),1:4} \\ -& hub\_balance_{balance,2:2}: \\ -& \qquad flow_{(balance,demand),1:3} = flow_{(ccgt,balance), 2:2} + flow_{(wind,balance),1:2} + flow_{(phs,balance),1:4} \\ -& hub\_balance_{balance,3:3}: \\ -& \qquad flow_{(balance,demand),1:3} = flow_{(ccgt,balance), 3:3} + flow_{(wind,balance),3:6} + flow_{(phs,balance),1:4} \\ -& hub\_balance_{balance,4:4}: \\ -& \qquad flow_{(balance,demand),4:6} = flow_{(ccgt,balance), 4:4} + flow_{(wind,balance),3:6} + flow_{(phs,balance),1:4}\\ -& hub\_balance_{balance,5:5}: \\ -& \qquad flow_{(balance,demand),4:6} = flow_{(ccgt,balance), 5:5} + flow_{(wind,balance),3:6} + flow_{(phs,balance),5:6} \\ -& hub\_balance_{balance,6:6}: \\ -& \qquad flow_{(balance,demand),4:6} = flow_{(ccgt,balance), 6:6} + flow_{(wind,balance),3:6} + flow_{(phs,balance),5:6} \\ - +& \text{hub\_balance}_{\text{balance},1:1}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 1:1} + v^{\text{flow}}_{(\text{wind},\text{balance}),1:2} + v^{\text{flow}}_{(\text{phs},\text{balance}),1:4} \\ +& \text{hub\_balance}_{\text{balance},2:2}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 2:2} + v^{\text{flow}}_{(\text{wind},\text{balance}),1:2} + v^{\text{flow}}_{(\text{phs},\text{balance}),1:4} \\ +& \text{hub\_balance}_{\text{balance},3:3}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 3:3} + v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{phs},\text{balance}),1:4} \\ +& \text{hub\_balance}_{\text{balance},4:4}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 4:4} + v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{phs},\text{balance}),1:4}\\ +& \text{hub\_balance}_{\text{balance},5:5}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 5:5} + v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{phs},\text{balance}),5:6} \\ +& \text{hub\_balance}_{\text{balance},6:6}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} = v^{\text{flow}}_{(\text{ccgt},\text{balance}), 6:6} + v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{phs},\text{balance}),5:6} \\ \end{aligned} ``` @@ -198,8 +197,8 @@ The flows connected to the CCGT conversion unit have different resolutions, too. ```math \begin{aligned} -& conversion\_balance_{ccgt,1:6}: \\ -& \qquad 6 \cdot p^{eff}_{(H2,ccgt)} \cdot flow_{(H2,ccgt),1:6} = \frac{1}{p^{eff}_{(ccgt,balance)}} \sum_{k=1}^{6} flow_{(ccgt,balance),k} \\ +& \text{conversion\_balance}_{\text{ccgt},1:6}: \\ +& \qquad 6 \cdot p^{\text{eff}}_{(\text{H2},\text{ccgt})} \cdot v^{\text{flow}}_{(\text{H2},\text{ccgt}),1:6} = \frac{1}{p^{\text{eff}}_{(\text{ccgt},\text{balance})}} \sum_{b=1}^{6} v^{\text{flow}}_{(\text{ccgt},\text{balance}),b} \\ \end{aligned} ``` @@ -213,10 +212,10 @@ Since the storage unit only has one input and output, the capacity limit constra ```math \begin{aligned} -& max\_output\_flows\_limit_{phs,1:4}: \\ -& \qquad flow_{(phs,balance),1:4} \leq p^{init\_capacity}_{phs} \\ -& max\_output\_flows\_limit_{phs,5:6}: \\ -& \qquad flow_{(phs,balance),5:6} \leq p^{init\_capacity}_{phs} \\ +& \text{max\_output\_flows\_limit}_{\text{phs},1:4}: \\ +& \qquad v^{\text{flow}}_{(\text{phs},\text{balance}),1:4} \leq p^{\text{init capacity}}_{\text{phs}} \\ +& \text{max\_output\_flows\_limit}_{\text{phs},5:6}: \\ +& \qquad v^{\text{flow}}_{(\text{phs},\text{balance}),5:6} \leq p^{\text{init capacity}}_{\text{phs}} \\ \end{aligned} ``` @@ -224,10 +223,10 @@ And the constraints for the inputs of the storage are (i.e., charging capacity l ```math \begin{aligned} -& max\_input\_flows\_limit_{phs,1:3}: \\ -& \qquad flow_{(phs,balance),1:3} \leq p^{init\_capacity}_{phs} \\ -& max\_input\_flows\_limit_{phs,4:6}: \\ -& \qquad flow_{(phs,balance),4:6} \leq p^{init\_capacity}_{phs} \\ +& \text{max\_input\_flows\_limit}_{\text{phs},1:3}: \\ +& \qquad v^{\text{flow}}_{(\text{wind},\text{phs}),1:3} \leq p^{\text{init capacity}}_{\text{phs}} \\ +& \text{max\_input\_flows\_limit}_{\text{phs},4:6}: \\ +& \qquad v^{\text{flow}}_{(\text{wind},\text{phs}),4:6} \leq p^{\text{init capacity}}_{\text{phs}} \\ \end{aligned} ``` @@ -237,8 +236,8 @@ Similarly, each outflow is limited to the `ccgt` capacity for the conversion uni ```math \begin{aligned} -& max\_output\_flows\_limit_{ccgt,k}: \\ -& \qquad flow_{(ccgt,balance),k} \leq p^{init\_capacity}_{ccgt} \quad \forall k \in [1,6] \\ +& \text{max\_output\_flows\_limit}_{\text{ccgt},b}: \\ +& \qquad v^{\text{flow}}_{(\text{ccgt},\text{balance}),b} \leq p^{\text{init capacity}}_{\text{ccgt}} \quad \forall b \in [1,6] \\ \end{aligned} ``` @@ -249,23 +248,23 @@ Therefore, the constraints are as follows: ```math \begin{aligned} -& max\_output\_flows\_limit_{wind,1:2}: \\ -& \qquad flow_{(wind,balance),1:2} + flow_{(wind,phs),1:3} \leq \frac{p^{init\_capacity}_{wind}}{2} \cdot \sum_{k=1}^{2} p^{profile}_{wind,k} \\ -& max\_output\_flows\_limit_{wind,3}: \\ -& \qquad flow_{(wind,balance),3:6} + flow_{(wind,phs),1:3} \leq p^{init\_capacity}_{wind} \cdot p^{profile}_{wind,3} \\ -& max\_output\_flows\_limit_{wind,4:6}: \\ -& \qquad flow_{(wind,balance),3:6} + flow_{(wind,phs),4:6} \leq \frac{p^{init\_capacity}_{wind}}{2} \cdot \sum_{k=5}^{6} p^{profile}_{wind,k} \\ +& \text{max\_output\_flows\_limit}_{\text{wind},1:2}: \\ +& \qquad v^{\text{flow}}_{(\text{wind},\text{balance}),1:2} + v^{\text{flow}}_{(\text{wind},\text{phs}),1:3} \leq \frac{p^{\text{init capacity}}_{\text{wind}}}{2} \cdot \sum_{b=1}^{2} p^{\text{availability profile}}_{\text{wind},b} \\ +& \text{max\_output\_flows\_limit}_{\text{wind},3}: \\ +& \qquad v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{wind},\text{phs}),1:3} \leq p^{\text{init capacity}}_{\text{wind}} \cdot p^{\text{availability profile}}_{\text{wind},3} \\ +& \text{max\_output\_flows\_limit}_{\text{wind},4:6}: \\ +& \qquad v^{\text{flow}}_{(\text{wind},\text{balance}),3:6} + v^{\text{flow}}_{(\text{wind},\text{phs}),4:6} \leq \frac{p^{\text{init capacity}}_{\text{wind}}}{2} \cdot \sum_{b=5}^{6} p^{\text{availability profile}}_{\text{wind},b} \\ \end{aligned} ``` -Since the flow variables $flow_{(wind, balance),1:2}$ and $flow_{(wind, balance),1:3}$ represent power, the first constraint sets the upper bound of the power for both time step 1 and 2, by assuming an average capacity across these two time steps. The same applies to the other two constraints. +Since the flow variables $v^{\text{flow}}_{(\text{wind}, \text{balance}),1:2}$ and $v^{\text{flow}}_{(\text{wind}, \text{balance}),1:3}$ represent power, the first constraint sets the upper bound of the power for both time step 1 and 2, by assuming an average capacity across these two time steps. The same applies to the other two constraints. The hydrogen (H2) producer capacity limit is straightforward since both the asset and the flow definition are in the exact time resolution: ```math \begin{aligned} -& max\_output\_flows\_limit_{H2,1:6}: \\ -& \qquad flow_{(H2,ccgt),1:6} \leq p^{init\_capacity}_{wind} \cdot p^{profile}_{H2,1:6} \\ +& \text{max\_output\_flows\_limit}_{\text{H2},1:6}: \\ +& \qquad v^{\text{flow}}_{(\text{H2},\text{ccgt}),1:6} \leq p^{\text{init capacity}}_{\text{H2}} \cdot p^{\text{availability profile}}_{\text{H2},1:6} \\ \end{aligned} ``` @@ -275,19 +274,19 @@ For the connection from the hub to the demand, there are associated transmission ```math \begin{aligned} -& max\_transport\_flows\_limit_{(balance,demand),1:3}: \\ -& \qquad flow_{(balance,demand),1:3} \leq p^{init\_export\_capacity}_{(balance,demand)} \\ -& max\_transport\_flows\_limit_{(balance,demand),4:6}: \\ -& \qquad flow_{(balance,demand),4:6} \leq p^{init\_export\_capacity}_{(balance,demand)} \\ +& \text{max\_transport\_flows\_limit}_{(\text{balance},\text{demand}),1:3}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} \leq p^{\text{init export capacity}}_{(\text{balance},\text{demand})} \\ +& \text{max\_transport\_flows\_limit}_{(\text{balance},\text{demand}),4:6}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} \leq p^{\text{init export capacity}}_{(\text{balance},\text{demand})} \\ \end{aligned} ``` ```math \begin{aligned} -& min\_transport\_flows\_limit_{(balance,demand),1:3}: \\ -& \qquad flow_{(balance,demand),1:3} \geq - p^{init\_import\_capacity}_{(balance,demand)} \\ -& min\_transport\_flows\_limit_{(balance,demand),4:6}: \\ -& \qquad flow_{(balance,demand),4:6} \geq - p^{init\_import\_capacity}_{(balance,demand)} \\ +& \text{min\_transport\_flows\_limit}_{(\text{balance},\text{demand}),1:3}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),1:3} \geq - p^{\text{init import capacity}}_{(\text{balance},\text{demand})} \\ +& \text{min\_transport\_flows\_limit}_{(\text{balance},\text{demand}),4:6}: \\ +& \qquad v^{\text{flow}}_{(\text{balance},\text{demand}),4:6} \geq - p^{\text{init import capacity}}_{(\text{balance},\text{demand})} \\ \end{aligned} ``` @@ -297,8 +296,8 @@ Since the system has a storage asset, we must limit the maximum storage level. T ```math \begin{aligned} -& max\_storage\_level\_limit_{phs,1:6}: \\ -& \qquad storage\_level_{phs,1:6} = p^{init\_storage\_capacity}_{phs} +& \text{max\_storage\_level\_limit}_{\text{phs},1:6}: \\ +& \qquad v^{\text{intra-storage}}_{\text{phs},1:6} \leq p^{\text{init storage capacity}}_{\text{phs}} \end{aligned} ``` @@ -364,6 +363,7 @@ map = CSV.read(map_file, DataFrame, header = 2) # hide unstacked_map = unstack(map, :period, :rep_period, :weight) # hide rename!(unstacked_map, ["period", "k=1", "k=2", "k=3"]) # hide unstacked_map[!,["k=1", "k=2", "k=3"]] = convert.(Float64, unstacked_map[!,["k=1", "k=2", "k=3"]]) # hide +unstacked_map # hide ``` The file `assets-timeframe-partitions` has the information on how often we want to consider the inter-temporal constraints that combine the information of the representative periods. In this example, we define a uniform distribution of one period, meaning that we will check the inter-storage level every day of the week in the timeframe. diff --git a/docs/src/formulation.md b/docs/src/formulation.md index 1a78a34f..11500bdf 100644 --- a/docs/src/formulation.md +++ b/docs/src/formulation.md @@ -1,68 +1,102 @@ # [Mathematical Formulation](@id formulation) -This section shows the mathematical formulation of the model, assuming that the temporal definition of time steps is the same for all the elements in the model.\ -The complete mathematical formulation considering variable temporal resolutions is also freely available in the [preprint](https://arxiv.org/abs/2309.07711). In addition, the feature section has an example of how the model handles the [`flexible time resolution`](@ref flex-time-res). +This section shows the mathematical formulation of _TulipaEnergyModel.jl_, assuming that the temporal definition of time steps is the same for all the elements in the model.\ +The complete mathematical formulation, including variable temporal resolutions, is also freely available in the [preprint](https://arxiv.org/abs/2309.07711). In addition, the feature section has an example of how the model handles the [`flexible time resolution`](@ref flex-time-res). ## [Sets](@id math-sets) -| Name | Description | Elements | Superset | Notes | -| ---------------------------- | --------------------------------------------------- | ------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -| $\mathcal{A}$ | Energy assets | $a \in \mathcal{A}$ | | The Energy asset types (i.e., consumer, producer, storage, hub, and conversion) are mutually exclusive | -| $\mathcal{A}^{\text{c}}$ | Consumer energy assets | | $\mathcal{A}^{\text{c}} \subseteq \mathcal{A}$ | | -| $\mathcal{A}^{\text{p}}$ | Producer energy assets | | $\mathcal{A}^{\text{p}} \subseteq \mathcal{A}$ | | -| $\mathcal{A}^{\text{s}}$ | Storage energy assets | | $\mathcal{A}^{\text{s}} \subseteq \mathcal{A}$ | | -| $\mathcal{A}^{\text{ss}}$ | Seaonal Storage energy assets | | $\mathcal{A}^{\text{ss}} \subseteq \mathcal{A}^{\text{s}}$ | | -| $\mathcal{A}^{\text{h}}$ | Hub energy assets (e.g., transshipment) | | $\mathcal{A}^{\text{h}} \subseteq \mathcal{A}$ | | -| $\mathcal{A}^{\text{cv}}$ | Conversion energy assets | | $\mathcal{A}^{\text{cv}} \subseteq \mathcal{A}$ | | -| $\mathcal{A}^{\text{i}}$ | Energy assets with investment method | | $\mathcal{A}^{\text{i}} \subseteq \mathcal{A}$ | | -| $\mathcal{F}$ | Flow connections between two assets | $f \in \mathcal{F}$ | | | -| $\mathcal{F}^{\text{t}}$ | Transport flow between two assets | | $\mathcal{F}^{\text{t}} \subseteq \mathcal{F}$ | | -| $\mathcal{F}^{\text{ti}}$ | Transport flow with investment method | | $\mathcal{F}^{\text{ti}} \subseteq \mathcal{F}^{\text{t}}$ | | -| $\mathcal{F}^{\text{in}}_a$ | Set of flows going into asset $a$ | | $\mathcal{F}^{\text{in}}_a \subseteq \mathcal{F}$ | | -| $\mathcal{F}^{\text{out}}_a$ | Set of flows going out of asset $a$ | | $\mathcal{F}^{\text{out}}_a \subseteq \mathcal{F}$ | | -| $\mathcal{P}$ | Periods in the timeframe | $p \in \mathcal{P}$ | $\mathcal{P} \subset \mathbb{N}$ | | -| $\mathcal{K}$ | Representative periods (rp) | $k \in \mathcal{K}$ | $\mathcal{K} \subset \mathbb{N}$ | $\mathcal{K}$ does not have to be a subset of $\mathcal{P}$ | -| $\mathcal{B}_{k}$ | Timesteps blocks within a representative period $k$ | $b_{k} \in \mathcal{B}_k$ | | $\mathcal{B}_k$ is a partition of timesteps in a representative period $k$ | +### Sets for Assets + +| Name | Description | Elements | Superset | Notes | +| ------------------------- | --------------------------------------- | ------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +| $\mathcal{A}$ | Energy assets | $a \in \mathcal{A}$ | | The Energy asset types (i.e., consumer, producer, storage, hub, and conversion) are mutually exclusive | +| $\mathcal{A}^{\text{c}}$ | Consumer energy assets | | $\mathcal{A}^{\text{c}} \subseteq \mathcal{A}$ | | +| $\mathcal{A}^{\text{p}}$ | Producer energy assets | | $\mathcal{A}^{\text{p}} \subseteq \mathcal{A}$ | | +| $\mathcal{A}^{\text{s}}$ | Storage energy assets | | $\mathcal{A}^{\text{s}} \subseteq \mathcal{A}$ | | +| $\mathcal{A}^{\text{h}}$ | Hub energy assets (e.g., transshipment) | | $\mathcal{A}^{\text{h}} \subseteq \mathcal{A}$ | | +| $\mathcal{A}^{\text{cv}}$ | Conversion energy assets | | $\mathcal{A}^{\text{cv}} \subseteq \mathcal{A}$ | | + +In addition, the following asset sets represent methods for incorporating additional variables and constraints in the model. + +| Name | Description | Elements | Superset | Notes | +| ------------------------- | ------------------------------------------ | -------- | ---------------------------------------------------------- | ----- | +| $\mathcal{A}^{\text{i}}$ | Energy assets with investment method | | $\mathcal{A}^{\text{i}} \subseteq \mathcal{A}$ | | +| $\mathcal{A}^{\text{ss}}$ | Storage energy assets with seasonal method | | $\mathcal{A}^{\text{ss}} \subseteq \mathcal{A}^{\text{s}}$ | | + +### Sets for Flows + +| Name | Description | Elements | Superset | Notes | +| ---------------------------- | ----------------------------------- | ------------------- | -------------------------------------------------- | ----- | +| $\mathcal{F}$ | Flow connections between two assets | $f \in \mathcal{F}$ | | | +| $\mathcal{F}^{\text{in}}_a$ | Set of flows going into asset $a$ | | $\mathcal{F}^{\text{in}}_a \subseteq \mathcal{F}$ | | +| $\mathcal{F}^{\text{out}}_a$ | Set of flows going out of asset $a$ | | $\mathcal{F}^{\text{out}}_a \subseteq \mathcal{F}$ | | + +In addition, the following flow sets represent methods for incorporating additional variables and constraints in the model. + +| Name | Description | Elements | Superset | Notes | +| ------------------------- | ----------------------------------------------- | -------- | ---------------------------------------------------------- | ----- | +| $\mathcal{F}^{\text{t}}$ | Flow between two assets with a transport method | | $\mathcal{F}^{\text{t}} \subseteq \mathcal{F}$ | | +| $\mathcal{F}^{\text{ti}}$ | Transport flow with investment method | | $\mathcal{F}^{\text{ti}} \subseteq \mathcal{F}^{\text{t}}$ | | + +### Sets for Temporal Structures + +| Name | Description | Elements | Superset | Notes | +| ----------------- | --------------------------------------------------- | ------------------------- | -------------------------------- | -------------------------------------------------------------------------- | +| $\mathcal{P}$ | Periods in the timeframe | $p \in \mathcal{P}$ | $\mathcal{P} \subset \mathbb{N}$ | | +| $\mathcal{K}$ | Representative periods (rp) | $k \in \mathcal{K}$ | $\mathcal{K} \subset \mathbb{N}$ | $\mathcal{K}$ does not have to be a subset of $\mathcal{P}$ | +| $\mathcal{B}_{k}$ | Timesteps blocks within a representative period $k$ | $b_{k} \in \mathcal{B}_k$ | | $\mathcal{B}_k$ is a partition of timesteps in a representative period $k$ | ## [Parameters](@id math-parameters) +### Parameter for Assets + | Name | Domain | Domains of Indices | Description | Units | | ------------------------------------------- | ---------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------- | -| $p^{\text{investment cost}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Investment cost of a unit of asset $a$ | [kEUR/MW/year] | -| $p^{\text{investment limit}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Investment limit of a unit of asset $a$ | [MW] | -| $p^{\text{unit capacity}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Capacity per unit of asset $a$ | [MW] | -| $p^{\text{peak demand}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{c}}$ | Peak demand of consumer asset $a$ | [MW] | +| $p^{\text{inv cost}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Investment cost of a unit of asset $a$ | [kEUR/MW/year] | +| $p^{\text{inv limit}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Investment potential of asset $a$ | [MW] | +| $p^{\text{capacity}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Capacity per unit of asset $a$ | [MW] | | $p^{\text{init capacity}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$ | Initial capacity of asset $a$ | [MW] | -| $p^{\text{variable cost}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}$ | Variable cost of flow $f$ | [kEUR/MWh] | -| $p^{\text{eff}}_f$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}$ | Efficiency of flow $f$ | [p.u.] | -| $p^{\text{investment cost}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Investment cost of transport flow $f$ | [kEUR/MW/year] | -| $p^{\text{investment limit}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Investment limit of a unit of flow $f$ | [MW] | -| $p^{\text{capacity increment}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Capacity increment for investments of transport flow $f$ (both exports and imports) | [MW] | -| $p^{\text{init export capacity}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Initial export capacity of transport flow $f$ | [MW] | -| $p^{\text{init import capacity}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Initial import capacity of transport flow $f$ | [MW] | -| $p^{\text{rp weight}}_{k}$ | $\mathbb{R}_{+}$ | $k \in \mathcal{K}$ | Weight of representative period $k$ | [-] | +| $p^{\text{peak demand}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{c}}$ | Peak demand of consumer asset $a$ | [MW] | +| $p^{\text{energy to power ratio}}_a$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Energy to power ratio of storage asset $a$ | [h] | +| $p^{\text{init storage capacity}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Initial storage capacity of storage asset $a$ | [MWh] | +| $p^{\text{init storage level}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Initial storage level of storage asset $a$ | [MWh] | | $p^{\text{availability profile}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Availability profile of asset $a$ in the representative period $k$ and timestep block $b_k$ | [p.u.] | -| $p^{\text{availability profile}}_{f,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{F}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Availability profile of flow $f$ in the representative period $k$ and timestep block $b_k$ | [p.u.] | | $p^{\text{demand profile}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{c}}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Demand profile of consumer asset $a$ in the representative period $k$ and timestep block $b_k$ | [p.u.] | | $p^{\text{inflows}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Inflows of storage asset $a$ in the representative period $k$ and timestep block $b_k$ | [MWh] | | $p^{\text{max intra level}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Maximum intra-storage level profile of storage asset $a$ in representative period $k$ and timestep block $b_k$ | [p.u.] | | $p^{\text{min intra level}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Minimum intra-storage level profile of storage asset $a$ in representative period $k$ and timestep block $b_k$ | [p.u.] | | $p^{\text{max inter level}}_{a,p}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $p \in \mathcal{P}$ | Maximum inter-storage level profile of storage asset $a$ in the period $p$ of the timeframe | [p.u.] | | $p^{\text{min inter level}}_{a,p}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $p \in \mathcal{P}$ | Minimum inter-storage level profile of storage asset $a$ in the period $p$ of the timeframe | [p.u.] | -| $p^{\text{energy to power ratio}}_a$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Energy to power ratio of storage asset $a$ | [h] | -| $p^{\text{init storage capacity}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Initial storage capacity of storage asset $a$ | [MWh] | -| $p^{\text{init storage level}}_{a}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}}$ | Initial storage level of storage asset $a$ | [MWh] | -| $p^{\text{map}}_{p,k}$ | $\mathbb{R}_{+}$ | $p \in \mathcal{P}$, $k \in \mathcal{K}$ | Map with the weight of representative period $k$ in period $p$ | [-] | + +### Parameter for Flows + +| Name | Domain | Domains of Indices | Description | Units | +| ------------------------------------------- | ---------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | -------------- | +| $p^{\text{variable cost}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}$ | Variable cost of flow $f$ | [kEUR/MWh] | +| $p^{\text{eff}}_f$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}$ | Efficiency of flow $f$ | [p.u.] | +| $p^{\text{inv cost}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Investment cost of transport flow $f$ | [kEUR/MW/year] | +| $p^{\text{inv limit}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Investment potential of flow $f$ | [MW] | +| $p^{\text{capacity}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Capacity per unit of investment of transport flow $f$ (both exports and imports) | [MW] | +| $p^{\text{init export capacity}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Initial export capacity of transport flow $f$ | [MW] | +| $p^{\text{init import capacity}}_{f}$ | $\mathbb{R}_{+}$ | $f \in \mathcal{F}^{\text{t}}$ | Initial import capacity of transport flow $f$ | [MW] | +| $p^{\text{availability profile}}_{f,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{F}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Availability profile of flow $f$ in the representative period $k$ and timestep block $b_k$ | [p.u.] | + +### Parameter for Temporal Structures + +| Name | Domain | Domains of Indices | Description | Units | +| -------------------------- | ---------------- | ---------------------------------------- | -------------------------------------------------------------- | ----- | +| $p^{\text{rp weight}}_{k}$ | $\mathbb{R}_{+}$ | $k \in \mathcal{K}$ | Weight of representative period $k$ | [-] | +| $p^{\text{map}}_{p,k}$ | $\mathbb{R}_{+}$ | $p \in \mathcal{P}$, $k \in \mathcal{K}$ | Map with the weight of representative period $k$ in period $p$ | [-] | ## [Variables](@id math-variables) -| Name | Domain | Domains of Indices | Description | Units | -| ---------------------------- | ---------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------- | -| $v^{\text{flow}}_{f,k,b_k}$ | $\mathbb{R}$ | $f \in \mathcal{F}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Flow $f$ between two assets in representative period $k$ and timestep block $b_k$ | [MW] | -| $v^{\text{investment}}_{a}$ | $\mathbb{Z}_{+}$ | $a \in \mathcal{A}^{\text{i}}$ | Number of invested units of asset $a$ | [units] | -| $v^{\text{investment}}_{f}$ | $\mathbb{Z}_{+}$ | $f \in \mathcal{F}^{\text{i}}$ | Number of invested capacity increments of flow $f$ | [units] | -| $s^{\text{intra}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Intra storage level (within a representative period) for storage asset $a$, representative period $k$, and timestep block $b_k$ | [MWh] | -| $s^{\text{inter}}_{a,p}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{s}}}$, $p \in \mathcal{P}$ | Inter storage level (between representative periods) for storage asset $a$ and period $p$ | [MWh] | +| Name | Domain | Domains of Indices | Description | Units | +| ------------------------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------- | +| $v^{\text{flow}}_{f,k,b_k}$ | $\mathbb{R}$ | $f \in \mathcal{F}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Flow $f$ between two assets in representative period $k$ and timestep block $b_k$ | [MW] | +| $v^{\text{inv}}_{a}$ | $\mathbb{Z}_{+}$ | $a \in \mathcal{A}^{\text{i}}$ | Number of invested units of asset $a$ | [units] | +| $v^{\text{inv}}_{f}$ | $\mathbb{Z}_{+}$ | $f \in \mathcal{F}^{\text{ti}}$ | Number of invested units of capacity increment of transport flow $f$ | [units] | +| $v^{\text{intra-storage}}_{a,k,b_k}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}$, $k \in \mathcal{K}$, $b_k \in \mathcal{B_k}$ | Intra storage level (within a representative period) for storage asset $a$, representative period $k$, and timestep block $b_k$ | [MWh] | +| $v^{\text{inter-storage}}_{a,p}$ | $\mathbb{R}_{+}$ | $a \in \mathcal{A^{\text{ss}}}$, $p \in \mathcal{P}$ | Inter storage level (between representative periods) for storage asset $a$ and period $p$ | [MWh] | ## [Objective Function](@id math-objective-function) @@ -79,8 +113,8 @@ Where: ```math \begin{aligned} -assets\_investment\_cost &= \sum_{a \in \mathcal{A}^{\text{i}}} p^{\text{investment cost}}_{a} \cdot p^{\text{unit capacity}}_{a} \cdot v^{\text{investment}}_{a} \\ -flows\_investment\_cost &= \sum_{f \in \mathcal{F}^{\text{ti}}} p^{\text{investment cost}}_{f} \cdot p^{\text{capacity increment}}_{f} \cdot v^{\text{investment}}_{f} \\ +assets\_investment\_cost &= \sum_{a \in \mathcal{A}^{\text{i}}} p^{\text{inv cost}}_{a} \cdot p^{\text{capacity}}_{a} \cdot v^{\text{inv}}_{a} \\ +flows\_investment\_cost &= \sum_{f \in \mathcal{F}^{\text{ti}}} p^{\text{inv cost}}_{f} \cdot p^{\text{capacity}}_{f} \cdot v^{\text{inv}}_{f} \\ flows\_variable\_cost &= \sum_{f \in \mathcal{F}} \sum_{k \in \mathcal{K}} \sum_{b_k \in \mathcal{B_k}} p^{\text{rp weight}}_{k} \cdot p^{\text{variable cost}}_{f} \cdot v^{\text{flow}}_{f,k,b_k} \end{aligned} ``` @@ -93,7 +127,7 @@ flows\_variable\_cost &= \sum_{f \in \mathcal{F}} \sum_{k \in \mathcal{K}} \sum_ ```math \begin{aligned} -\sum_{f \in \mathcal{F}^{\text{out}}_a} v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{a,k,b_k} \cdot \left(p^{\text{init capacity}}_{a} + p^{\text{unit capacity}}_{a} \cdot v^{\text{investment}}_{a} \right) \quad +\sum_{f \in \mathcal{F}^{\text{out}}_a} v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{a,k,b_k} \cdot \left(p^{\text{init capacity}}_{a} + p^{\text{capacity}}_{a} \cdot v^{\text{inv}}_{a} \right) \quad \\ \\ \forall a \in \mathcal{A}^{\text{cv}} \cup \mathcal{A}^{\text{s}} \cup \mathcal{A}^{\text{p}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} \end{aligned} ``` @@ -102,7 +136,7 @@ flows\_variable\_cost &= \sum_{f \in \mathcal{F}} \sum_{k \in \mathcal{K}} \sum_ ```math \begin{aligned} -\sum_{f \in \mathcal{F}^{\text{in}}_a} v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{a,k,b_k} \cdot \left(p^{\text{init capacity}}_{a} + p^{\text{unit capacity}}_{a} \cdot v^{\text{investment}}_{a} \right) \quad +\sum_{f \in \mathcal{F}^{\text{in}}_a} v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{a,k,b_k} \cdot \left(p^{\text{init capacity}}_{a} + p^{\text{capacity}}_{a} \cdot v^{\text{inv}}_{a} \right) \quad \\ \\ \forall a \in \mathcal{A}^{\text{s}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} \end{aligned} ``` @@ -126,13 +160,13 @@ v^{\text{flow}}_{f,k,b_k} \geq 0 \quad \forall f \notin \mathcal{F}^{\text{t}}, ### Constraints for Energy Storage Assets -Regarding energy storage assets, there are two constraint types: intra-temporal and inter-temporal. Intra-temporal constraints are limitations within the representative periods, while inter-temporal constraints are restrictions between the representative periods. Inter-temporal constraints allow us to model seasonal storage by mapping the representative periods $\mathcal{K}$ to the periods $\mathcal{P}$ in the model's timeframe. For more information on this topic, refer to Tejada-Arango et al. (2018) and Tejada-Arango et al. (2019) in the [reference](@ref math-references) section. +There are two types of constraints for energy storage assets: intra-temporal and inter-temporal. Intra-temporal constraints impose limits within the representative periods, while inter-temporal constraints restrict storage between representative periods. Inter-temporal constraints allow us to model seasonal storage by mapping the representative periods $\mathcal{K}$ to the periods $\mathcal{P}$ in the model's timeframe. For more information on this topic, refer to [Tejada-Arango et al. (2018)](https://ieeexplore.ieee.org/document/8334256) and [Tejada-Arango et al. (2019)](https://www.sciencedirect.com/science/article/pii/S0360544219317748). -#### Intra-temporal Constraint for Storage Balance +#### [Intra-temporal Constraint for Storage Balance](@id intra-storage-balance) ```math \begin{aligned} -s^{\text{intra}}_{a,k,b_k} = s^{\text{intra}}_{a,k,b_k-1} + p^{\text{inflows}}_{a,k,b_k} + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \cdot v^{\text{flow}}_{f,k,b_k} - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \cdot v^{\text{flow}}_{f,k,b_k} \quad +v^{\text{intra-storage}}_{a,k,b_k} = v^{\text{intra-storage}}_{a,k,b_k-1} + p^{\text{inflows}}_{a,k,b_k} + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \cdot v^{\text{flow}}_{f,k,b_k} - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \cdot v^{\text{flow}}_{f,k,b_k} \quad \\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} \end{aligned} ``` @@ -140,37 +174,55 @@ s^{\text{intra}}_{a,k,b_k} = s^{\text{intra}}_{a,k,b_k-1} + p^{\text{inflows}}_ #### Intra-temporal Constraint for Maximum Storage Level Limit ```math -s^{\text{intra}}_{a,k,b_k} \leq p^{\text{max intra level}}_{a,k,b_k} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{investment}}_{a}) \quad +v^{\text{intra-storage}}_{a,k,b_k} \leq p^{\text{max intra level}}_{a,k,b_k} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{inv}}_{a}) \quad \\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} ``` #### Intra-temporal Constraint for Minimum Storage Level Limit ```math -s^{\text{intra}}_{a,k,b_k} \geq p^{\text{min intra level}}_{a,k,b_k} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{investment}}_{a}) \quad +v^{\text{intra-storage}}_{a,k,b_k} \geq p^{\text{min intra level}}_{a,k,b_k} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{inv}}_{a}) \quad \\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} ``` #### Intra-temporal Constraint for Cycling Constraint -If parameter $p^{\text{init storage level}}_{a}$ is defined, the intra-storage level of the last timestep block ($b^{\text{last}}_k$) in each representative period must be greater than this initial value. +The cycling constraint for the intra-temporal constraints links the first timestep block ($b^{\text{first}}_k$) and the last one ($b^{\text{last}}_k$) in each representative period. The parameter $p^{\text{init storage level}}_{a}$ determines the considered equations in the model for this constraint: + +- If parameter $p^{\text{init storage level}}_{a}$ is not defined, the intra-storage level of the last timestep block ($b^{\text{last}}_k$) is used as the initial value for the first timestep block in the [intra-temporal constraint for the storage balance](@ref intra-storage-balance). + +```math +\begin{aligned} +v^{\text{intra-storage}}_{a,k,b^{\text{first}}_k} = v^{\text{intra-storage}}_{a,k,b^{\text{last}}_k} + p^{\text{inflows}}_{a,k,b^{\text{first}}_k} + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \cdot v^{\text{flow}}_{f,k,b^{\text{first}}_k} - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \cdot v^{\text{flow}}_{f,k,b^{\text{first}}_k} \quad +\\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K} +\end{aligned} +``` + +- If parameter $p^{\text{init storage level}}_{a}$ is defined, we use it as the initial value for the first timestep block in the [intra-temporal constraint for the storage balance](@ref intra-storage-balance). In addition, the intra-storage level of the last timestep block ($b^{\text{last}}_k$) in each representative period must be greater than this initial value. ```math -s^{\text{intra}}_{a,k,B_k} \geq p^{\text{init storage level}}_{a} \quad +\begin{aligned} +v^{\text{intra-storage}}_{a,k,b^{\text{first}}_k} = p^{\text{init storage level}}_{a} + p^{\text{inflows}}_{a,k,b^{\text{first}}_k} + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \cdot v^{\text{flow}}_{f,k,b^{\text{first}}_k} - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \cdot v^{\text{flow}}_{f,k,b^{\text{first}}_k} \quad \\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K} +\end{aligned} ``` -#### Inter-temporal Constraint for Storage Balance +```math +v^{\text{intra-storage}}_{a,k,b^{\text{first}}_k} \geq p^{\text{init storage level}}_{a} \quad +\\ \\ \forall a \in \mathcal{A}^{\text{s}} \setminus \mathcal{A}^{\text{ss}}, \forall k \in \mathcal{K} +``` -This constraint allows us to consider the storage's seasonality throughout the model's timeframe (e.g., a year). The parameter $p^{\text{map}}_{p,k}$ determines how much of the representative period $k$ is in the period $p$, and you can use a clustering technique to calculate it. For _TulipaEnergyModel.jl_, we recommend using [_TulipaClustering.jl_](https://github.com/TulipaEnergy/TulipaClustering.jl) to compute the clusters for the representative periods and their map. +#### [Inter-temporal Constraint for Storage Balance](@id inter-storage-balance) -For the sake of simplicity, we show the constraint assuming that we are calculating the inter-storage level between two consecutive periods $p$; however, _TulipaEnergyModel.jl_ can handle more flexible period block definition through the timeframe definition in the model using the information in the file [`assets-timeframe-partitions.csv`](@ref assets-timeframe-partitions). +This constraint allows us to consider the storage seasonality throughout the model's timeframe (e.g., a year). The parameter $p^{\text{map}}_{p,k}$ determines how much of the representative period $k$ is in the period $p$, and you can use a clustering technique to calculate it. For _TulipaEnergyModel.jl_, we recommend using [_TulipaClustering.jl_](https://github.com/TulipaEnergy/TulipaClustering.jl) to compute the clusters for the representative periods and their map. + +For the sake of simplicity, we show the constraint assuming the inter-storage level between two consecutive periods $p$; however, _TulipaEnergyModel.jl_ can handle more flexible period block definition through the timeframe definition in the model using the information in the file [`assets-timeframe-partitions.csv`](@ref assets-timeframe-partitions). ```math \begin{aligned} -s^{\text{inter}}_{a,p} = & s^{\text{inter}}_{a,p-1} + \sum_{\rho = p-1}^{p} \sum_{k \in \mathcal{K}} p^{\text{map}}_{\rho,k} \sum_{b_k \in \mathcal{B_K}} p^{\text{inflows}}_{a,k,b_k} \\ -& + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \sum_{\rho = p-1}^{p} \sum_{k \in \mathcal{K}} p^{\text{map}}_{\rho,k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} \\ -& - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \sum_{\rho = p-1}^{p} \sum_{k \in \mathcal{K}} p^{\text{map}}_{\rho,k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} +v^{\text{inter-storage}}_{a,p} = & v^{\text{inter-storage}}_{a,p-1} + \sum_{k \in \mathcal{K}} p^{\text{map}}_{p,k} \sum_{b_k \in \mathcal{B_K}} p^{\text{inflows}}_{a,k,b_k} \\ +& + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \sum_{k \in \mathcal{K}} p^{\text{map}}_{p,k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} \\ +& - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \sum_{k \in \mathcal{K}} p^{\text{map}}_{p,k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} \\ \\ & \forall a \in \mathcal{A}^{\text{ss}}, \forall p \in \mathcal{P} \end{aligned} ``` @@ -178,23 +230,45 @@ s^{\text{inter}}_{a,p} = & s^{\text{inter}}_{a,p-1} + \sum_{\rho = p-1}^{p} \sum #### Inter-temporal Constraint for Maximum Storage Level Limit ```math -s^{\text{inter}}_{a,p} \leq p^{\text{max inter level}}_{a,p} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{investment}}_{a}) \quad +v^{\text{inter-storage}}_{a,p} \leq p^{\text{max inter level}}_{a,p} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{inv}}_{a}) \quad \\ \\ \forall a \in \mathcal{A}^{\text{ss}}, \forall p \in \mathcal{P} ``` #### Inter-temporal Constraint for Minimum Storage Level Limit ```math -s^{\text{inter}}_{a,p} \geq p^{\text{min inter level}}_{a,p} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{investment}}_{a}) \quad +v^{\text{inter-storage}}_{a,p} \geq p^{\text{min inter level}}_{a,p} \cdot (p^{\text{init storage capacity}}_{a} + p^{\text{energy to power ratio}}_a \cdot p^{\text{init capacity}}_{a} \cdot v^{\text{inv}}_{a}) \quad \\ \\ \forall a \in \mathcal{A}^{\text{ss}}, \forall p \in \mathcal{P} ``` #### Inter-temporal Constraint for Cycling Constraint -If parameter $p^{\text{init storage level}}_{a}$ is defined, the inter-storage level of the last timestep block ($p^{\text{last}}$) in each representative period must be greater than this initial value. +The cycling constraint for the inter-temporal constraints links the first-period block ($p^{\text{first}}$) and the last one ($p^{\text{last}}$) in the timeframe. The parameter $p^{\text{init storage level}}_{a}$ determines the considered equations in the model for this constraint: + +- If parameter $p^{\text{init storage level}}_{a}$ is not defined, the inter-storage level of the last period block ($p^{\text{last}}$) is used as the initial value for the first-period block in the [inter-temporal constraint for the storage balance](@ref inter-storage-balance). ```math -s^{\text{inter}}_{a,p^{\text{last}}} \geq p^{\text{init storage level}}_{a} \quad +\begin{aligned} +v^{\text{inter-storage}}_{a,p^{\text{first}}} = & v^{\text{inter-storage}}_{a,p^{\text{last}}} + \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} p^{\text{inflows}}_{a,k,b_k} \\ +& + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} \\ +& - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} +\\ \\ & \forall a \in \mathcal{A}^{\text{ss}} +\end{aligned} +``` + +- If parameter $p^{\text{init storage level}}_{a}$ is defined, we use it as the initial value for the first-period block in the [inter-temporal constraint for the storage balance](@ref inter-storage-balance). In addition, the inter-storage level of the last period block ($p^{\text{last}}$) in the timeframe must be greater than this initial value. + +```math +\begin{aligned} +v^{\text{inter-storage}}_{a,p^{\text{first}}} = & p^{\text{init storage level}}_{a} + \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} p^{\text{inflows}}_{a,k,b_k} \\ +& + \sum_{f \in \mathcal{F}^{\text{in}}_a} p^{\text{eff}}_f \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} \\ +& - \sum_{f \in \mathcal{F}^{\text{out}}_a} \frac{1}{p^{\text{eff}}_f} \sum_{k \in \mathcal{K}} p^{\text{map}}_{p^{\text{first}},k} \sum_{b_k \in \mathcal{B_K}} v^{\text{flow}}_{f,k,b_k} +\\ \\ & \forall a \in \mathcal{A}^{\text{ss}} +\end{aligned} +``` + +```math +v^{\text{inter-storage}}_{a,p^{\text{last}}} \geq p^{\text{init storage level}}_{a} \quad \\ \\ \forall a \in \mathcal{A}^{\text{ss}} ``` @@ -226,7 +300,7 @@ s^{\text{inter}}_{a,p^{\text{last}}} \geq p^{\text{init storage level}}_{a} \qua ```math \begin{aligned} -v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{f,k,b_k} \cdot \left(p^{\text{init export capacity}}_{f} + p^{\text{capacity increment}}_{f} \cdot v^{\text{investment}}_{f} \right) \quad +v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{f,k,b_k} \cdot \left(p^{\text{init export capacity}}_{f} + p^{\text{capacity}}_{f} \cdot v^{\text{inv}}_{f} \right) \quad \\ \\ \forall f \in \mathcal{F}^{\text{t}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} \end{aligned} ``` @@ -235,7 +309,7 @@ v^{\text{flow}}_{f,k,b_k} \leq p^{\text{availability profile}}_{f,k,b_k} \cdot \ ```math \begin{aligned} -v^{\text{flow}}_{f,k,b_k} \geq - p^{\text{availability profile}}_{f,k,b_k} \cdot \left(p^{\text{init import capacity}}_{f} + p^{\text{capacity increment}}_{f} \cdot v^{\text{investment}}_{f} \right) \quad +v^{\text{flow}}_{f,k,b_k} \geq - p^{\text{availability profile}}_{f,k,b_k} \cdot \left(p^{\text{init import capacity}}_{f} + p^{\text{capacity}}_{f} \cdot v^{\text{inv}}_{f} \right) \quad \\ \\ \forall f \in \mathcal{F}^{\text{t}}, \forall k \in \mathcal{K},\forall b_k \in \mathcal{B_k} \end{aligned} ``` @@ -245,17 +319,21 @@ v^{\text{flow}}_{f,k,b_k} \geq - p^{\text{availability profile}}_{f,k,b_k} \cdot #### Maximum Investment Limit for Assets ```math -v^{\text{investment}}_{a} \leq \frac{p^{\text{investment limit}}_{a}}{p^{\text{unit capacity}}_{a}} \quad +v^{\text{inv}}_{a} \leq \frac{p^{\text{inv limit}}_{a}}{p^{\text{capacity}}_{a}} \quad \\ \\ \forall a \in \mathcal{A}^{\text{i}} ``` +If the parameter `investment_integer` in the [`assets-data.csv`](@ref assets-data) file is set to true, then the RHS of this constraint uses a least integer function (ceiling function) to guarantee that the limit is integer. + #### Maximum Investment Limit for Flows ```math -v^{\text{investment}}_{f} \leq \frac{p^{\text{investment limit}}_{f}}{p^{\text{capacity increment}}_{f}} \quad +v^{\text{inv}}_{f} \leq \frac{p^{\text{inv limit}}_{f}}{p^{\text{capacity}}_{f}} \quad \\ \\ \forall f \in \mathcal{F}^{\text{ti}} ``` +If the parameter `investment_integer` in the [`flows-data.csv`](@ref flows-data) file is set to true, then the RHS of this constraint uses a least integer function (ceiling function) to guarantee that the limit is integer. + ## [References](@id math-references) Tejada-Arango, D.A., Domeshek, M., Wogrin, S., Centeno, E., 2018. Enhanced representative days and system states modeling for energy storage investment analysis. IEEE Transactions on Power Systems 33, 6534–6544. doi:10.1109/TPWRS.2018.2819578.