1 Introduction

Multi-horizon stochastic programming Kaut et al. (2019) is a modelling framework for reducing size of optimization models with several time scales, typically a combination of strategic (long-term) and operational (short-term) decisions. It works by decoupling the strategic and operational decisions, as described in the next section. This allows for a significant reduction in the size of the generated models and consequently in the required solution time.

The trade-off for this simplification is that the decoupling prevents accurate modelling of long-term storages, such as hydropower with multi-year reservoirs. In this paper, we present formulas for approximation of inventory levels and required storage capacities, for several types of storages and model structures. This is expected to broaden the range of models to which the multi-horizon approach can be applied.

The remainder of the paper is structured as follows: We start by outlining the main aspects of the multi-horizon modelling approach in Sect. 1 and introducing the relevant components of our ‘base’ optimization model in Sect. 2. Following this, we describe how to add long-term storage to the model in Sect. 3 and demonstrate the proposed approach on a test case in Sect. 4.

2 Multi-horizon modelling

To understand the concept of the multi-horizon approach, consider an optimization model for designing an energy infrastructure with the objective to minimize the overall costs while meeting a specified energy demand. This necessitates the use of two types of variables in the models: strategic decisions related to the infrastructure and operational decisions concerning its usage, potentially under different scenarios. We assume that the strategic decisions occur infrequently and refer to the time intervals between them as strategic periods, typically measured in months or years. Conversely, the frequency of the operational decisions must be such that it adequately captures the system dynamics, typically ranging from seconds to hours.

Fig. 1
figure 1

Structure of a simple model with two strategic-decision nodes

This results in a model structure depicted in Fig. 1, with strategic nodes denoted by ‘

’ and operational nodes by ‘

’. It is important to note that the sequence of operational nodes would typically be much longer, often extending to thousands of nodes—for instance, 1 year with hourly time steps equates to 8760 operational nodes.

Fig. 2
figure 2

Scenario tree with two strategic periods and four operational scenarios in each strategic node. Note that in the multi-horizon tree, the second strategic node is connected to the first strategic node, instead of the preceding operational nodes

Suppose we aim to evaluate the infrastructure using four operational scenarios instead of one, to obtain a more robust performance estimate. Typically, this would result in a structure depicted in Fig. 2a. It is evident that the model size grows exponentially with the number of periods, quickly leading to intractable models.

The multi-horizon approach circumvents this exponential growth by decoupling the strategic nodes from the operational scenarios, as shown in Fig. 2b. An alternative interpretation of the approach is that we construct a scenario tree for the strategic nodes and interpret the operational nodes as being ‘subtrees’ of their strategic nodes, as shown in Fig. 3,Footnote 1 In other words, we have two types of scenario structures, each with different time discretizations and horizons. While this approach can theoretically be generalized to more than two levels (hence its name), all papers and models we are aware of utilize only the two levels outlined above.

Fig. 3
figure 3

Multi-horizon scenario tree with both strategic uncertainty (modelled by the two strategic nodes in the second strat. period) and operational uncertainty (modelled by operational scenarios attached to all strategic nodes). Dashed lines represent the strategic tree, i.e., the connections between the strategic nodes

The multi-horizon approach is particularly well suited for large-scale energy-system models, such as the EMPIRE model (Backe et al. 2022; Skar et al. 2016) and the stochastic version of the TIMES model (Loulou and Lettila 2016; Seljom and Tomasgard 2015; Ringkjøb et al. 2020). It has also been applied to natural-gas infrastructure modelling (Hellemo et al. 2013), hydro-power planning (Abgottspon and Andersson 2016), optimization of building retrofits (Rocha et al. 2016), design of charging infrastructure (Bordin and Tomasgard 2019), power-system restructuring and capacity expansion (Backe et al. 2021; Bordin et al. 2021), and modelling of offshore energy hubs (Zhang et al. 2022).

In addition to applications, Maggioni et al. (2019) explores the theoretical properties of multi-horizon stochastic programs, including bounds on the significance of stochasticity in these models. Moreover, Zhang et al. (2023a, 2023b) develop several decomposition-based solution techniques that take advantage of the hierarchical structure of multi-horizon models. They achieved a significant reduction in solution times compared to generic decomposition methods.

2.1 Reducing the length of operational scenarios

Once we have separated the operational scenarios from different strategic nodes, we can further decrease the model size by reducing the length of the operational scenarios. For instance, instead of one yearly scenario, we can represent the year by one or more representative days or weeks and then scale their effects (costs etc.) to 1 year. With long strategic periods, this can reduce the model size by more than an order of magnitude, making this approach appealing for large-scale and long-term models. Notably, both the aforementioned energy-system models, EMPIRE and TIMES use this approach.

2.2 Long-term storage problem

The size-reduction comes at a cost: since we have eliminated the link between operational scenarios in consecutive strategic periods, the approach does not provide a natural way of modelling of storages spanning several strategic periods. This becomes even more complex if we use multiple representative periods instead of operational scenarios spanning the entire duration of the strategic periods. Strømholm and Rolfsen (2021) partially addressed this issue by providing formulas for the inventory level at the end of strategic periods, but their approach does not consider how this affects the required storage capacities.

This means that it has so far been impossible to use a multi-horizon model for dimensioning long-term storages—one can include them in the model, but their capacities would be adjusted for the representative periods in use (days or weeks), not for the period they are meant to represent (year).

In this paper, we address this issue and demonstrate how to approximate storage capacities and inventory levels for several types of operational scenarios and time scopes. For this, we utilize the HyOpt optimization model (Kaut et al. 2019), which is presented in the next section.

3 Relevant aspects of the HyOpt model

HyOpt is a model for optimal dimensioning of energy systems, implementing the concepts described in Sect. 1, with a scenario tree as in Fig. 3, i.e., a tree consisting of strategic-decisions nodes, each with an attached set of operational scenarios.

Given that HyOpt is a complex model, it is not feasible to present a complete formulation here. For this, we direct the reader to Kaut et al. (2019), or to our implementation in the FICO™ Mosel optimization language, freely available from https://gitlab.sintef.no/open-hyopt. Instead, this section presents a subsection of the model relevant to storage modelling.

3.1 Notation

3.1.1 Indices

$$\begin{aligned} \begin{array}{rl} sn &{} \text {strategic node, i.e., one node of the strategic scenario tree} \\ sc &{} \text {operational scenario} \\ op &{} \text {operational period} \end{array} \end{aligned}$$

3.1.2 Parameters

$$\begin{aligned} \begin{array}{rl} W^{\textrm{SC}}_{sn,sc}&{} \text {weight of oper.\ scenario sc in strategic node sn} \\ T^{\textrm{M}}_{sn,sc}&{} \text {time-scaling multiplier for scenario sc in strat.\ node sn} \\ M^{\textrm{SC}}_{sn,sc}&{} \text {overall multiplier for scenario sc in strat.\ node sn} \\ \Delta T^{\textrm{SP}}_{sn}&{} \text {duration of strategic period in strat.\ node sn} \\ \Delta T^{\textrm{SC}}_{sc}&{} \text {duration of operational scenario sc} \\ \Delta T^{\textrm{OP}}_{sc,op}{} &{} \text {duration of oper.\ period op in operational scenario sc} \end{array} \end{aligned}$$

3.2 Scenario-tree structure in HyOpt

In HyOpt, the strategic scenario tree consists of strategic nodes, each belonging to one strategic period. A strategic scenario is a path from the root of the strategic tree to one of the leaves.

Each of the strategic nodes has one or more operational scenarios associated with it. These scenarios can vary in length and time resolution. Each scenario also has an assigned weight \(W^{\textrm{SC}}_{sn,sc}\), denoting the time spent in the scenario as a fraction of the strategic period—implying \(\sum _{sc} W^{\textrm{SC}}_{sn,sc}= 1\) for all strategic nodes sn.

If the duration of an operational scenario does not match the duration of its associated strategic period, we must scale all effects of the scenario up to the strategic period using the multiplier

$$\begin{aligned} M^{\textrm{SC}}_{sn,sc}&= W^{\textrm{SC}}_{sn,sc}\times T^{\textrm{M}}_{sn,sc}\end{aligned}$$
(1)

where

$$\begin{aligned} T^{\textrm{M}}_{sn,sc}&= \Delta T^{\textrm{SP}}_{sn}/ \Delta T^{\textrm{SC}}_{sc}\,. \end{aligned}$$
(2)
Table 1 Weights and multipliers of 3 operational scenarios in a 1-year strategic period (\(\Delta T^{\textrm{SP}}_{sn}\) = 365 days)

As an example, Table 1 shows a situation where a strategic node in a 1-year strategic period has three operational scenarios, two weekly for normal situations and one daily representing an extreme day. There, the last column shows how may days of the year are represented by each scenario. The table also illustrates that the weights do not equate to probabilities if the scenarios differ in length: the extreme day occurs (on average) once per year while each of the normal scenarios occurs 26 times, so the probabilities of these scenarios occurring are 1/53 and 26/53, respectively.

4 Storage handling

This section presents formulas for managing storages in the HyOpt model. In particular, we demonstrate how to adjust the storage capacity, dependent on the duration of the operational scenarios and the time-scale of the storages. We also introduce a new concept, scenario groups, and demonstrate its impact on the presented formulas.

4.1 Relevant notation

4.1.1 Indices

$$\begin{aligned} \begin{array}{rl} i&\text {storage node, i.e., node in the network modelling the system} \end{array} \end{aligned}$$

4.1.2 Variables

$$\begin{aligned} \begin{array}{ll} {\textbf {inv}}^{\mathrm {}}_{i,sn,sc,op}&{} \text {inventory level of storage i at the end of oper.\ period (sn,sc,op)} \\ {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,sc}} &{} \text {inventory level at the start of oper. scenario (sn,sc)} \\ {\textbf {inv}}^{\textrm{end}}_{i,sn{}{,sc}} &{} \text {inventory level at the end of oper. scenario (sn,sc)} \\ {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,}} &{} \text {initial inventory level of storage i at strat.\ node sn} \\ {\textbf {inv}}^{\textrm{end}}_{i,sn{}{,}} &{} \text {final inventory level of storage i at strat.\ node sn} \end{array} \end{aligned}$$

All the inventory variables are non-negative and limited by \({\textbf {cap}}^{\mathrm {}}_{s,sn}\), the capacity available at strat. node sn:

$$\begin{aligned} 0 \le {\textbf {inv}}^{\mathrm {}}_{i,sn,sc,op}\le {\textbf {cap}}^{\mathrm {}}_{i,sn} , \end{aligned}$$
(3)

and correspondingly for the other variables.

4.2 Scaling storages from operational scenarios

While costs can be scaled by \(M^{\textrm{SC}}_{sn,sc}\), managing storage needs additional consideration. At least two issues need attention: the inventory level at the end of a strategic period, and the minimum storage capacity required for the presented scenarios.

If we denote by \({\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}}\) the change of the inventory during oper. scenario sc,

$$\begin{aligned} {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} = {\textbf {inv}}^{\textrm{end}}_{i,sn{}{,sc}} - {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,sc}} , \end{aligned}$$

then the overall change in the inventory at strategic node sn is

$$\begin{aligned} {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,}} = \sum _{sc} M^{\textrm{SC}}_{sn,sc}\times {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} . \end{aligned}$$

Assuming further that all operational scenarios begin with the same inventory level,

$$\begin{aligned} {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,sc}} = {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,}} , \end{aligned}$$

the final inventory is given by Strømholm and Rolfsen (2021)

$$\begin{aligned} {\textbf {inv}}^{\textrm{end}}_{i,sn{}{,}} = {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,}} + {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,}}. \end{aligned}$$
(4)

The aforementioned requirement that all operational scenarios within a single strategic node begin with the same inventory level corresponds to the interpretation of operational scenarios as a set of possible random occurrences: since we do not know which scenario will happen, we cannot adjust inventory levels in anticipation.

Fig. 4
figure 4

Storage level changes with common starting point

This requirement also assists in determining the storage dimensions. To illustrate this, consider the three scenarios from Table 1 and assume that the inventory changes of storage i in the three scenarios are (10, \(-9\), \(-25\)), respectively. With a cost associated to the installed storage capacity and no additional constraints, the model will choose the minimum capacity that satisfies Eq. (3) in all scenarios. In our case, this leads to the inventory levels presented in Fig. 4, requiring storage capacity of 35.Footnote 2

However, it is important to note that this storage capacity is an underestimation. Considering that both ‘normal’ scenarios (scen. 1 and scen. 2) occur 26 times during the strategic period and assuming they occur randomly, we can expect multiple consecutive occurrences of each. This significantly increases the required capacity.

For instance, starting with two consecutive occurrences of scen. 1 results with an inventory level of \(25 + 2 \times 10 = 45\), requiring \({\textbf {cap}}^{\mathrm {}}_{i,sn} \!\ge \! 45\). Simultaneously, a single occurrence of scen. 2 preceded or followed by scen. 3 would lead to an infeasible inventory level \(25 - 25 - 9 = -9\). To avoid this infeasibility, the initial inventory level would need to increase to \(25 + 9 = 34\), requiring \({\textbf {cap}}^{\mathrm {}}_{i,sn} \!\ge \! 44\) ...and \({\textbf {cap}}^{\mathrm {}}_{i,sn} \!\ge \! 45 + 9 = 54\) if we wanted to consider the first sequence as well. In both cases, allowing more repetitions would increase the required capacity even further.

Conversely, if we were certain that the two normal scenarios alternate, then no repetitions could occur and \({\textbf {cap}}^{\mathrm {}}_{i,sn} \!=\! 44\) would be sufficient to cover all allowed permutations. This shows that the degree of capacity underestimation is inherently case-dependent.

4.3 Operational scenarios in sequence

In the previous sections, we assumed that operational scenarios occur randomly. However, this assumption does not hold when the scenarios represent sequential events, such as seasons within a year. This is frequently employed in long-term models, as shown in Skar et al. (2016) or Strømholm and Rolfsen (2021).

In these instances, the scenarios do not occur randomly throughout the strategic period. Rather, if we have one scenario per season, its probability is 100% during that season and 0% elsewhere. It follows that the scenarios occur consecutively—13 times in the case of weekly scenarios representing seasons. This significantly impacts the necessary storage capacity.

Table 2 Weights and multipliers of 5 operational scenarios
Fig. 5
figure 5

Storage level changes with oper. scenarios from Table 2 interpreted as random events

Fig. 6
figure 6

Storage level changes with oper. scenarios from Table 2, interpreted as four seasons in sequence with the ‘bad day’ scenario assigned to spring

To demonstrate this, consider the scenarios from Table 2. If we treat these as random events, the overall storage change is \(-5\) and the required capacity is 25, as shown in Fig. 5. To enable the scenarios to represent the sequence of seasons, we first need to decide how to manage the ‘bad day’ scenario. We have allocated it to spring, which is thus represented by two scenarios with a total inventory change of 190. The inventory-level changes for each scenario are displayed in the last column of Table 2 and the entire annual profile in Fig. 6. The figure shows that the minimal storage capacity required in this case is 195, nearly eight times more than in the original approach. Note that the total inventory-level change remains at \(-5\), unaffected by the grouping.

4.3.1 Extra model notation

To implement the scenario groups in the model, we need to introduce extra notation:

Parameters and sets

$$\begin{aligned} \begin{array}{cl} \varvec{G}^{\textrm{SC}}_{\!sn}&{} \text {Ordered list of scenario groups at strategic node sn} \\ \varvec{S}^{\textrm{G}}_{\!sn,g}&{} \text {Set of operational scenarios in group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ \Delta T^{\textrm{G}}_{sn,g}&{} \text {Duration of scenario group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ W^{\textrm{SC,G}}_{sn,g,sc}&{} \text {Relative weight of scenario sc within scen.\ group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ T^{\textrm{M,G}}_{sn,g,sc}&{} \text {Time scaling factor for scenario sc within scen.\ group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ M^{\textrm{SC,G}}_{sn,g,sc}&{} \text {Multiplier for scenario sc within scen.\ group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ \varvec{g}^{\mathrm {\textrm{first}}}_{\!sn}&{} \text {First scen.\ group in strat.\ node sn} \\ \varvec{g}^{\mathrm {\textrm{last}}}_{\!sn}&{} \text {Last scen.\ group in strat.\ node sn} \end{array} \end{aligned}$$

Variables

$$\begin{aligned} \begin{array}{ll} {\textbf {inv}}^{\textrm{G,init}}_{i,sn{}{,g}} &{} \text {inventory level at the start of scenario group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ {\textbf {inv}}^{\textrm{G,end}}_{i,sn{}{,g}} &{} \text {inventory level at the end of scenario group g} \in \varvec{G}^{\textrm{SC}}_{\!sn}\\ \end{array} \end{aligned}$$

The inventory-level variables are again non-negative and limited by \({\textbf {cap}}^{\mathrm {}}_{i,sn}\). In addition, the new entities are connected by the following relations:

$$\begin{aligned} W^{\textrm{SC,G}}_{sn,g,sc}&= W^{\textrm{SC}}_{sn,sc}\ / \sum _{{\tilde{sc}} \in g} W^{\textrm{SC}}_{sn,\tilde{sc}} \\ T^{\textrm{M,G}}_{sn,g,sc}&= \Delta T^{\textrm{G}}_{sn,g}/ \Delta T^{\textrm{OP}}_{sc,op}\\ M^{\textrm{SC,G}}_{sn,g,sc}&= W^{\textrm{SC}}_{sn,sc}\times T^{\textrm{M,G}}_{sn,g,sc}\\ {\textbf {inv}}^{\textrm{G,init}}_{i,sn{}{,\varvec{g}^{\mathrm {\textrm{first}}}_{\!sn}}}&= {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,}} \\ {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,sc}}&= {\textbf {inv}}^{\textrm{G,init}}_{i,sn{}{,g}} \\ {\textbf {inv}}^{\textrm{G,end}}_{i,sn{}{,g}}&= {\textbf {inv}}^{\textrm{G,init}}_{i,sn{}{,g}} + \sum _{{sc \in \varvec{S}^{\textrm{G}}_{\!sn,g}}} M^{\textrm{SC,G}}_{sn,g,sc}\times {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} \\ {\textbf {inv}}^{\textrm{G,init}}_{i,sn{}{,g}}&= {\textbf {inv}}^{\textrm{G,end}}_{i,sn{}{,g-1}} \text { if } g-1 \in \varvec{G}^{\textrm{SC}}_{\!sn}\text { else } {\textbf {inv}}^{\textrm{init}}_{i,sn{}{,sn}} \\ {\textbf {inv}}^{\textrm{end}}_{i,sn{}{,}}&= {\textbf {inv}}^{\textrm{G,end}}_{i,sn{}{,\varvec{g}^{\mathrm {\textrm{last}}}_{\!sn}}} \end{aligned}$$

where \(g \in \varvec{G}^{\textrm{SC}}_{\!sn}\) and \(sc \in \varvec{S}^{\textrm{G}}_{\!sn,g}\), in all constraints where they appear. Since we treat scenarios within each group as random events, we force them to start from a common initial level. The last constraint ensures that the installed capacity is big enough to handle also the final inventory level in the sequence.

4.3.2 Repeated scenarios

Now, consider the consequences of substituting the current summer scenario with the three weekly scenarios presented in Table 3. There, the last column includes the maximum inventory level during the scenario, relative to its initial level. This implies that the inventory in scenario ‘summer-1’ initially increases by 10 units and subsequently decreases, resulting in an overall change of \(+5\) units.

Table 3 Alternative scenarios for the summer group

Since \(30 - 72 - 23 = -65\), the total inventory change during summer remains unchanged, so the overall inventory profile stays the same as in Fig. 6—except that scenario ‘summer-1’ increases the required storage capacity from 195 to 205, to accommodate the maximum level reached during this scenario.

However, if this scenario were to occur consecutively two or more times, it would necessitate an even higher capacity. This implies that we need to determine the number of repetitions we wish to consider. The maximum number of repetitions is \(M^{\textrm{SC,G}}_{sn,g,sc}\); for ‘summer-1’, this translates to 6 consecutive occurrences—but this happens with a probability of only \((W^{\textrm{SC,G}}_{sn,g,sc})^6 = (6/13)^6 = 0.97\%\), so considering it might be overly conservative. Instead, we have opted to set a limit on the probability we intend to consider, denoted by \(P^{\textrm{R}}_{}\). This restricts the number of consecutive occurrences to

$$\begin{aligned} seq^{\textrm{G}}_{sn,g,sc}= \lfloor {\ln (P^{\textrm{R}}_{}) / \ln (W_{sn,s} / W^{\textrm{g}}_{sn,g})}\rfloor , \end{aligned}$$
(5)

bounded by 1 from below and \(M^{\textrm{SC}}_{sn,sc}\) from above.

In our case, we use \(P^{\textrm{R}}_{}= 5\%\). For ‘summer-1’, this means considering up to \(seq^{\textrm{G}}_{sn,g,sc}= \lfloor {\ln (0.05) / \ln (6/13)}\rfloor\) = 3 consecutive occurrences. In the initial one, the inventory level goes from 195 to 200, with a maximum at 205. The first repetition starts with inventory level of \(195 + 5 = 200\) and the second with \(195 + 2 \times 5 = 205\), with a maximum reaching \(205 + 2 \times 5 = 215\). This would thus become the new required capacity.

To incorporate this capacity requirement into the model, we merely need to address the final repetition, since the inventory levels change linearly throughout the sequence and the initial occurrence is already accounted for in the model and therefore satisfies Eq. (3). The last occurrence has inventory levels shifted by \((seq^{\textrm{G}}_{sn,g,sc}- 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}}\), so its version of Eq. (3) is

$$\begin{aligned} 0 \le {\textbf {inv}}^{\mathrm {}}_{i,sn,sc,op}+ (seq^{\textrm{G}}_{sn,g,sc}- 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} \le {\textbf {cap}}^{\mathrm {}}_{i,sn}, \end{aligned}$$
(6)

for all operational scenarios sc with \(seq^{\textrm{G}}_{sn,g,sc}> 1\).

4.3.3 Multi-year scenarios

Up until now, we have implicitly assumed that the strategic periods are annual, with the sequence of scenario groups (seasons) spanning the entire strategic period. If we extend the duration to two years, the overall storage-level change doubles to \(-10\) (\(-5\) each year), but this is clearly not the case for inventory levels. In fact, if the overall change in storage level were zero, the second year would mirror first, resulting in no change to the required storage capacity.

This can be addressed analogously to the scenario repetition, using

$$\begin{aligned} 0 \le {\textbf {inv}}^{\mathrm {}}_{i,sn,sc,op}+ (\lfloor {(\Delta T^{\textrm{SP}}_{sn}/ \sum _{{g \in \varvec{G}^{\textrm{SC}}_{\!sn}}}\Delta T^{\textrm{G}}_{sn,g}}\rfloor - 1)\, {\textbf {inv}}^{\mathrm {\Delta G}}_{i,sn{}{,}} \le {\textbf {cap}}^{\mathrm {}}_{i,sn}, \end{aligned}$$
(7)

where \({\textbf {inv}}^{\mathrm {\Delta G}}_{i,sn{}{,}}\) is the total inventory-level change in all the scenario groups,

$$\begin{aligned} {\textbf {inv}}^{\mathrm {\Delta G}}_{i,sn{}{,}} = \sum _{g \in \varvec{G}^{\textrm{SC}}_{\!sn}} \sum _{sc \in \varvec{S}^{\textrm{G}}_{\!sn,g}} {\textbf {inv}}^{\mathrm {\Delta G}}_{i,sn,g{}{,sc}} . \end{aligned}$$

We also need constraints that combine Eqs. (6) and (7), to accommodate repeated scenarios within repeated scenarios groups:

$$\begin{aligned} 0 \le {\textbf {inv}}^{\mathrm {}}_{i,sn,sc,op}+ (seq^{\textrm{G}}_{sn,g,sc}- 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} + (\lfloor {\Delta T^{\textrm{SP}}_{sn}/ \Delta T^{\textrm{G}}_{sn,g}}\rfloor - 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,}} \le {\textbf {cap}}^{\mathrm {}}_{i,sn}\end{aligned}$$
(8)

Note that Eq. (8) alone is not sufficient, and we need all Eqs. (6) to (8). To demonstrate this, assume that we have a scenario with a storage-level change of 10 and \(seq^{\textrm{G}}_{sn,g,sc}\!=\!4\), in a two-year strategic period with an overall inventory-level change of \(-30\). Then

$$\begin{aligned} (seq^{\textrm{G}}_{sn,g,sc}- 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} + (\lfloor {\Delta T^{\textrm{SP}}_{sn}/ \Delta T^{\textrm{G}}_{sn,g}}\rfloor - 1)\, {\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,}} = 3 \times 10 + 1 \times -30 = 0 , \end{aligned}$$

so Eq. (8) would not have no impact, but Eqs. (6) and (7) would still be necessary.

4.4 Initial and final inventory levels

In the absence of any constraints on initial and final inventory levels, the model is likely to opt for starting each operational scenario with full storage and ending it with an empty one, effectively gaining full storage at no cost. There are two common strategies to tackle this issue: assigning a value to the inventory or requiring that the storage ends with the same level as it started. In HyOpt, we use the latter approach with several time scopes for the storage-level looping, to distinguish between short- and long-term storages:

oper-scenario,:

where we require that the inventory level loops back in every operational scenario, i.e., \({\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,sc}} = 0\). This is typically used for batteries, where each scenario constitutes a daily or weekly ‘schedule’ with charging overnight.

scen-group,:

where we mandate that the inventory level loops back within each scenario group, i.e., \({\textbf {inv}}^{\mathrm {\Delta G}}_{i,sn,g{}{,}} = 0\). If the scenario groups represent seasons, this would suit storages that cycle in weeks or a few months, such as medium-sized hydrogen-storage systems or smaller hydro reservoirs.

strat-node,:

where we require that the inventory level at the end of a strategic node equals the initial level, i.e., \({\textbf {inv}}^{\mathrm {\Delta }}_{i,sn{}{,}} = 0\). With yearly strategic time periods, this corresponds to inter-seasonal storage like large hydrogen storage or mid-sized hydro reservoirs.

overall,:

where we mandate that the final inventory level at the end of all strategic nodes in the last strategic periods finishes on a level that equals the initial level in the first strategic period. This corresponds to large hydro reservoirs.

Note that a storage node with scope ‘strat-node’ or shorter would not, by definition, require Eqs. (7) and (8), and a storage node with ‘oper-scenario’ scope would not need Eq. (6) either.

The complete HyOpt implementation of the storage modelling, in the FICO™ Mosel modelling language, can be found in Appendix A.

5 Test case

We consider a small test case inspired by the LowEmission project,Footnote 3 which involves the electrification of an offshore installation using wind turbines combined with energy storage. In our case, the storage system is hydrogen-based, comprising an electrolyzer, a hydrogen tank, and fuel cells. In HyOpt, this results in a network structure presented in Fig. 7.

Fig. 7
figure 7

HyOpt representation of of the test case from Sect. 4. Red arrows represent flow of power, green arrows flow of hydrogen. Nodes whose capacities are being optimized are denoted by solid-line borders

The wind-production data are derived from actual wind-speed measurements from the Ekofisk field in the North Sea in years 2018–2022. These measurements, obtained from the Norwegian Meteorological Institute using its Frost API,Footnote 4 are converted into a wind-production capacity factor using a production profile for Vestas V164/8000 wind turbine, sourced from the Open Energy Platform.Footnote 5 We assume a constant power load of 20 MW. All cost and performance data are obtained from an open HyOpt test case, accessible at https://gitlab.sintef.no/open-hyopt/test-case-1.

5.1 Case variants

We evaluate the model using three time structures, \(1 \times 1\), \(1 \times 5\), and \(5 \times 1\), presented in Table 4. The \(a \times b\) notation represents a strategic periods, each lasting b years. For each time structure, we examine the impact of the following operational variants:

full,:

with one operational scenario per strategic period, spanning the entire length of the period.

mean,:

with four operational scenarios per strategic period, each lasting 1 week. Each scenario represents a season and is chosen as the week in the data whose average capacity factor is closest to the seasonal average within the given time interval.Footnote 6

mean+min,:

with eight weekly operational scenarios per strategic period. For each season, we select the week with the smallest above-average capacity factor, and the week with the smallest capacity factor as the worst case scenario. The scenario weights are chosen so that the weighted average is equal to the average capacity factor of the season.

In all cases, the operational scenarios use an hourly time resolution. We use astronomical definitions of seasons, where each season lasts three months and winter starts on December 1. As a result, our ‘year’ runs from December to November to ensure it consists of four complete seasons. In other words, when we refer to, for example, 2018, the actual interval is from December 1, 2017, to November 30, 2018.

Table 4 Model time structures considered in the test case
Table 5 Number of weeks in operational scenarios and the size reduction compared to the full model, for the tested time structures and model variants

The sizes of the scenario trees for the variants are summarized in Table 5. There, we observe that the size reduction from using the weekly scenarios ranges from 6.5 times to 32.5 times, compared to the case with a full time sequence.

To examine the effect of scenario groups, as described in Sect. 3.3, we use two versions of the multi-scenario variants (‘mean’ and ‘mean+min’):

fan,:

where all scenarios are interpreted as random events, resulting in a single ‘fan’ of scenarios.

groups,:

with scenarios grouped by season (one per season for ‘mean’ and two for ‘mean+min’).

This results in a total of five case variants for testing.

5.2 Results

Fig. 8
figure 8

Results for time struct. ‘\(1 \times 1\)’: one strat. period 1 year long

Fig. 9
figure 9

Results for time struct. ‘\(1 \times 5\)’: one strat. period 5 years long

Fig. 10
figure 10

Results for time struct. ‘\(5 \times 1\)’: 5 yearly strat. periods

All test variants were solved using FICO™ Xpress Solver v 8.14, on a laptop with Intel® Core™ i7-7600U CPU operating at 2.80 GHz, and 16 GB of RAM. The results for the 1-year case are displayed in Figs. 8, 9 and 10. There, the left panels confirm that the solution times for the scenario-based versions are significantly shorter than for the ‘full’ model, with a speed-up corresponding to the problem-size reduction shown in Table 5. Specifically, the speed-up ranges from 5–6 in the worst case of the ‘\(5 \times 1\)’ variant to over 100 for the ‘\(1 \times 5\)’ variant.

In terms of the objective function, i.e., the total costs, we can make the following observations:

  • The ‘mean+min’ variants are more costly than ‘mean’. This is expected, as they must account for the extreme scenarios.

  • The ‘groups’ variants are more costly than ‘fan’. This indicates that the dynamics introduced by the grouping is effective, compelling the model to handle multiple consecutive occurrences of scenarios representing a single season.

  • The ‘mean+min_groups’ variants can be more costly than ‘full’. This could be because the scenario variants force the model to handle both the ‘min’ scenario and multiple occurrences of the ‘mean’ scenarios simultaneously (at the start of each season), while the actual sequence in the ‘full’ variant might be easier to manage.

The last point is important: Eq. (6) compels the model to consider multiple repetitions of the involved scenarios, up to the specified probability. As a result, the solutions have to handle many different permutations of the involved scenarios. The ‘full’ variant, on the other hand, allows the model to adapt the solution to the one scenario (historical data) included in the tree. Consequently, the scenario selection might yield more expensive solutions.

However, this does not necessarily mean that the scenarios lead to better solutions. For instance, consider a 12-week season represented by two weekly scenarios of equal weight, where the inventory level increases by 10 in the first scenario and decreases by 10 in the second. With a \(5\%\) limit on scenario repetitions, we get \(\textrm{rep}_{s,sn,g} = 4\), so the model will have to handle up to four consecutive occurrences of either scenario. This will require the storage capacity to be at least 80, to allow the inventory to both increase and decrease by 40 units, assuming it starts at 40. If the two scenarios in reality tend to alternate and never occur more than twice consecutively, the actual storage-capacity requirement would be lower and so would be the total costs.

The right panels of Figs. 8, 9 and 10 illustrate the sources of the costs. We can see that increased wind variability (i.e., more scenarios) is addressed by a combination of increased hydrogen storage and increased wind-production capacity. Specifically, in the ‘\(1 \times 1\)’ variant, the most expensive case is the one with largest storage, while in the ‘\(1 \times 5\)’ and ‘\(5 \times 1\)’ variants, it is the one with the largest wind park. This interplay between the two components makes it difficult to draw conclusions about the effects of the scenario structure on either of them alone.

6 Conclusions

This paper presents a methodology for modelling long-term storage within the multi-horizon modelling paradigm, including an approximation of the required storage capacities. This overcomes a significant barrier for the adoption of this modelling approach, thereby broadening its applicability to a wider range of problems.

The proposed formulation is implemented in the HyOpt optimization model, which is freely accessible from https://gitlab.sintef.no/open-hyopt/. The test case from Sect. 4 can be found at https://gitlab.sintef.no/open-hyopt/test-case-2. This includes scripts for solving the problems using pyHyOpt, a python interface to HyOpt, also available from the HyOpt page.