Operational flexibility for multi-purpose usage of pooled battery storage systems

The multi-purpose usage of battery energy storage systems (BESSs) increases the exploitation of their flexibility potential. This can be further enhanced when a large number of small BESSs are combined into a swarm and marketed collectively by an aggregator. To this end, a unified representation of remaining flexibility for each BESS is needed that meets the requirements of both, a multi-purpose usage and a distributed swarm design. In this work, we present a compact model which we call abstract multi-purpose-limited flexibility (Amplify). It can be used by an aggregator to determine how much flexibility remains after accepting obligations and includes an integrated detection of conflicts in the planned schedule of a BESS. It is shown that the model is quickly computable and does not need much data volume during transmission.


Introduction
Battery energy storage systems (BESSs) are essential components in renewable power systems (IRENA 2017;Ioannis et al. 2018). Examples of a primary application (PA) of a BESS, i.e. the use case for which it was mainly purchased, are peak shaving, uninterrupted power supply, self-consumption optimization, and use for frequency containment reserve (FCR) (Figgener et al. 2021). In many cases though, BESSs do not fully exploit their capabilities when used solely for one of these PAs. Thus, multi-purpose use of BESSs is an active field of research, to maximize the revenue of the battery operator (Hauer et al. 2020;Namor et al. 2018;Marchgraber and Gawlik 2021;Englberger et al. 2019;Holly et al. 2020).
In this work, we assume a scenario in which multiple BESSs are pooled into a swarm, as a group of semi-autonomous agents-each representing one BESS-jointly optimizing a common objective. Each agent determines the remaining flexibility of its BESS after ensuring the provisioning of the PA, which is based on a forecast, e.g., on the consumption behavior of the consumer. Subsequently, the flexibility of the included BESSs is transmitted to an aggregator who bundles it to make commitments fulfilling one or more secondary applications (SAs), like trading on (local) energy/ ancillary service markets, or balance group management, which alone would not refund the battery investment. After the aggregator has used flexibility, it must allocate shares of the commitment to individual agents, respectively BESSs. Here, these resulting shares are referred to as multi-purpose obligations (MPOs).
For a successful multi-purpose usage of BESSs in such a scenario, an operational model of the remaining flexibility is crucial. The model has to be able to express which additional MPOs can be accepted while considering the constraints implied by the technical device and the PA. This understanding of flexibility for multi-purpose use corresponds to the definition of flexibility proposed in Mauser et al. (2017). Our research objective was to find a model which fulfills the requirements from our multipurpose scenario as follows: 1 Multi-use of single battery storage (a) Technical limits: To ensure that no technical limits are violated, the model must respect the constraints induced by the battery storage. (b) Primary application: The model must ensure that the PA can be satisfied and no capacity is offered which could jeopardize its fulfillment. (c) Secondary application: The model must incorporate existing obligations from SAs when offering remaining flexibility.
2 Swarm capabilities (a) Abstraction: The model should implement an abstract notion on flexibility so the aggregator does not need battery parameters to fulfill SAs. (b) Efficient calculation: The flexibility must be quickly computable even with limited computing resources of edge devices to allow running it on low-cost hardware. (c) Conflict awareness: If an aggregator only receives an abstract representation, it might not detect all problems. Thus, the flexibility modeling approach should be able to detect conflicts between applications. (d) Compact representation: The model should be communicable via public networks without causing too much tariff fee or facing high delays.
In this work, a flexibility model is presented and evaluated that meets these requirements. The remainder of this work is organized as follows: We first review existing flexibility modeling approaches for distributed energy resources and discuss why these are not suitable for the outlined scenario. Afterwards we present the newly developed flexibility model Amplify for BESSs, including a detailed description of the calculation procedure, and explain the problem detection process. Finally, we validate our modeling approach, discuss some limitations and visualize its behavior.

Related work
Several approaches for the modeling of battery storage systems (Yang et al. 2016) or their flexibility (Chicco et al. 2020;Berahmandpour et al. 2019;Brandt et al. 2022) have been presented. In the following, we review exemplary flexibility models with respect to the previously defined requirements. Lombardi and Schwabe highlight the increase in economic efficiency when a storage system is specifically offered for multiple uses (Lombardi and Schwabe 2017). Rott et al. discuss the usage of a BESS for grid-oriented applications combined with further use cases as for market or system purposes (Rott and Nykamp 2017). One of their presented strategies combines FCR with either negative frequency restoration reserve or arbitrage at the spot market. It is discussed how a BESS can take part in a FCR pool. Shi et al. use the storage simultaneously for peak shaving and frequency regulation (Shi et al. 2018). However, neither in Rott and Nykamp (2017) nor in Shi et al. (2018), the authors did address all requirements regarding swarm capabilities. Engels et al. present a controller to combine the provision of FCR with self-consumption (Engels et al. 2017) or with peak shaving (Engels et al. 2019). When combining self-consumption and FCR, the energy and power limits for performing selfconsumption are limited to ensure the availability of sufficient energy and power for frequency containment. Thus, in this approach obligations from a PA are considered before committing to the SA (here self-consumption). The authors furthermore aggregate several battery storage systems at multiple sites for FCR and peak shaving. This approach also fulfills some of the previously defined requirements regarding swarm capabilities since it enables efficient problem solving (Engels 2020). Nevertheless, their approach does not consider abstraction or conflict awareness. Ulbig and Andersson present metrics and implement a framework to quantify power system operational flexibility and a method to aggregate it (Ulbig and Andersson 2015). The authors use ramp-rate, power, and energy to assess the operational flexibility of one or multiple power system units. They do not focus on multi-purpose or swarm capabilities. Bremer and Sonnenschein describe a support vector decoder for modeling the feasible region as search space of operable schedules for units (Bremer and Sonnenschein 2014). The authors point out the need for efficient communication and state the efficiency of modeling the feasible region (Bremer and Sonnenschein 2013). Neither in Bremer and Sonnenschein (2014) nor in Bremer and Sonnenschein (2013) multi-purpose usage or conflict awareness are considered in detail. Thus, to our knowledge, none of the approaches described above contributes a model for operational flexibility, which meets all requirements resulting from our scenario.

Flexibility calculation
To fill the presented gap, Amplify (abstract multi-purpose-limited flexibility) was developed. We take peak shaving (PS) as an exemplary PA, for which the usage of a BESS is described e.g., in Tull de Salis et al. The result of Amplify is composed of four vectors, each of which consists of one value per time interval: the minimum and maximum power flexibility and the minimum and maximum energy flexibility. It refers to the idea of operational flexibility from Ulbig and Andersson (2015), which consists of a power gradient, a power and an energy dimension and allows a unified representation.
If all obligations can be met (for the other case see section Problem handling), the remaining flexibility is calculated by a four-step procedure as shown in Fig. 1: 1 Available power range: The battery power is curtailed in order to meet power requirements from peak shaving and additional applications. 2 Allowed state of charge range: Calculate the state of charge (SoC) which can and which has to be reached to meet all requirements, while respecting the available power range as well as charge and discharge efficiencies.
a. Forward integration: Calculate which SoC can be reached starting from the current SoC level. b. Backward integration: Calculate which SoC is required before peak shaving or MPOs.
3 Power flexibility: Apply SoC restrictions to the available power range. 4 Energy flexibility: Convert SoC range to energy range and respect efficiency losses.

Battery model
In this work, we apply the battery storage model from Tiemann et al. (2020), of which we neglect the self discharge rate. There, a battery is modeled by a capacity C E , maximum charge/discharge power P max s,ch / P max s,dis , and charge/discharge efficiencies η s,ch /η s,dis . Controlled by a desired set point P des (t) , a battery will provide as much power as possible depending on its power limits and the current SoC F (t) ∈ [0, 1] . Charge power is considered as positive and discharge power as negative.

Time
The model is calculated for uniform time intervals (e.g., 15 min: t intv = 15 min ), which are expressed by an indexed time consideration. The current point in time t 0 always lies within the current interval of index i t = 0.
T max = i max t · t intv is the planning horizon with i max t the number of respected time intervals. T 0 ≤ t 0 is the beginning of the current time interval.

Primary application: peak shaving
Given the primary use case peak shaving, a residual load curve P res (i t ) below a predefined peak shaving limit P max,set peak (i t ) is calculated. The storage has to balance negative values of P res (i t ) with discharge power and cannot exceed positive values in order to perform peak shaving: As the future residual load is usually not known in advance, a forecast P fcast (i t ) is used in order to consider the customer load profile. Other PA can be performed if their requirements are representable as residual load curve as well.

Secondary purposes
Obligations from energy market trading are respected as power values per time interval, of which the battery's power has to reach or exceed the respective value. Here, we use P mpo ch (i t ) ≥ 0 for charge and P mpo dis (i t ) ≤ 0 for discharge MPOs. The generation of economically meaningful MPOs would e.g. be performed by some kind of market intelligence, but does not lie within the scope of this work.

Available power range
At the start of the flexibility calculation, we assume unrestricted battery power, where each element of the maximum/minimum power vector equals the maximum battery charge/discharge power P max s,ch /P max s,dis . This power range is then reduced independently for each time interval in order to meet all obligations from PA and MPOs (without consideration of the SoC): In case of the current interval ( i t = 0 ), the already passed time and performed power of the battery have to be respected as well. Here, P s,0 (t 0 ) is the average power at the outer battery terminals from the beginning of the current time interval T 0 until the current point in time t 0 :

Allowed state of charge range
In a second step, we calculate how much energy can be and has to be charged in order to meet all requirements while respecting the SoC within the battery as well as the charge and discharge efficiency. This is performed in two parallel sub-steps (sections Forward integration -reachable state of charge and Backward integration -required state of charge) which are combined after calculation. To keep the notation tight, efficiencies are considered as follows: Forward integration-reachable state of charge In this step, the maximum and minimum reachable SoC are calculated by applying the available power range.
Thereby, the start SoC F s (0) is virtual, as it is not guaranteed that it actually occurred at the start of the current interval. However, it would have been the case, if the storage had steadily delivered the average power P s,0 (t 0 ): Backward integration-required state of charge In this step, the maximum and minimum required SoC is calculated in order to be able to fulfill peak shaving and the MPOs. It is calculated as follows: The maximum and minimum SoC, which the battery could reach after the end of the forecast horizon F max s,requ (i max t + 1) and F min s,requ (i max t + 1) can be adjusted as required. In this work, F max s,requ (i max t + 1) is set to 1 and F min s,requ (i max t + 1) is set to 0. As they do not lie within the forecast horizon, no limitation is assumed meaningful.
Combination of forward and backward integration The most restrictive combination of reachable and required SoC results in the allowed SoC range: Based on the current forecast, the battery can fulfill all scheduled obligations if its SoC is kept within this range.

Power flexibility
In order to derive what power set points a battery can perform if the SoC is considered, we combine the information from the allowed SoC range and the available power range. For each time interval, the maximum and minimum power is calculated individually. It displays the power, with which the battery can be charged or discharged, without exceeding the allowed SoC range. The power flexibility constitutes the more restrictive constraint respectively: It can be interpreted as the maximum individual power values which can be offered by the battery without compromising the obligations from either purpose.

Energy flexibility
The energy flexibility allows to schedule obligations of a battery which last longer than one time interval. It expresses the amount of energy (not SoC) with which the battery can be charged or discharged. To this end, the allowed SoC range is scaled with the energy capacity of the battery.
To respect that discharge MPOs actually consume additional energy due to efficiency losses, the minimum SoC F min s,incr is increased: For each time interval, the maximum dischargeable energy (maximum delta of the SoC) is calculated. For this, the earliest point in time j t is determined at which continuous discharging without intermediate charge obligation can be started. Three conditions have to hold for j t (i t ) and the interval I = [j t (i t ), i t ] . First, the time of j t (i t ) cannot be in the past. Second, it has to be earlier in time than i t . Third, the storage must not have to charge in I.
Upon that, l t (i t ) ∈ [j t (i t ), i t ] is set such that it maximizes the dischargeable energy, which is limited by either the maximum SoC F max s (l t ) or the maximum discharge power until i t , which is integrated over time up to E max s,dis : Finally, the minimum SoC is increased by the efficiency losses, which would occur if the battery is discharged by the maximum dischargeable energy: In case the minimum energy flexibility exceeds the maximum energy flexibility due to the increase because of efficiency losses, we set the maximum energy flexibility to the same value. This way, we prevent offering more energy flexibility than is available due to efficiency losses. The presented procedure results in four vectors, the minimum and maximum power flexibility and the minimum and maximum energy flexibility. They represent the remaining flexibility of a battery if the requirements for peak shaving as the PA and additional MPOs are met. Amplify is designed such that the offered flexibility can be used, but it is not guaranteed that the battery is fully utilized by calling the entire flexibility. The abstract representation as power and energy allows the aggregator to neglect battery specific parameters. If a new MPO lasts for only one time interval (15 min), only the power flexibility has to be considered. If it lasts for multiple time intervals, all power values of it have to lie within the power flexibility. The energy trajectory, which results from an integration of these power values, has to fit into the energy flexibility range, so that a BESS can fulfill the new MPO. Subsequent power values within one MPO are allowed to differ, but it is important that they do not change sign, such that pure charge or discharge MPOs are generated (interim zero values are allowed). Due to the dense representation, the flexibility can be transmitted from distributed batteries or their agents without causing extensive network traffic. Amplify can be used to size new MPOs which can be given to the battery. After a new MPO was accepted, flexibility has to be recalculated in order to display the remaining potential correctly. The handling and effect of already accepted MPOs is not discussed here for reasons of brevity.

Problem handling
The presented flexibility model supports only MPOs that do not conflict with the PA and already accepted MPOs. The obligations from the different purposes can conflict nonetheless e.g. due to a change of the forecast. In the described scenario, we assume that an agent distributes such unfulfillable obligations to other agents in a self-organized way or returns them to the aggregator (cf. Fig. 3).
Amplify comes with a problem detection algorithm which can detect a conflict as a socalled planning problem (PP). We distinguish between power induced problems P1 and energy induced problems P2 as displayed in Fig. 2. The process of problem detection is performed prior to the flexibility calculation shown in Fig. 1 and it is explained on a high level in this section. It will return a set of input parameters for the procedure in Fig. 1. In that, the MPOs or the forecasted customer load are reduced to solve all conflicts. This way, a consistent calculation of the remaining flexibility becomes possible, while it is assumed that no problems persist (at least by means that exceed the capabilities of the battery agent). The customer load can be too high to be shaved by the installed battery down to the adjusted peak shaving limit P max,set peak (i t ) or may include peaks that last too long to be capped by a battery. The battery cannot solve this problems, since it is not possible to increase the maximum discharge power or the stored energy. The yielded PPs from Amplify then serve as a warning to the aggregator to take other measures (e.g., load shedding or increase P max,set peak (i t ) ). The problem detection identifies how much of a forecasted peak could be shaved by using the full discharge power or stored energy.
Problems P1.2 and P2.2/P2.3 The battery might not be able to fulfill already accepted MPOs without causing a peak in the customer load if its forecast increased over time or because of a too low/high SoC. The problem detection identifies how many of the accepted MPOs can be fulfilled by using the full battery discharge power and stored energy/space in the battery. Exceeding MPO power is marked unfulfillable and can be returned to the aggregator or the swarm of agents.

Evaluation
A first set of experimental tests, consisting of a large number of flexibility computations, asserts that the calculation results in a consistent output, while physical constraints, the PA, and the SA are fulfilled or conflicts are detected (req. 1(a), (b) and (c)). For reasons of brevity, it cannot be discussed here that new MPOs can be sized based on the abstract flexibility representation without causing PPs and no further information about the BESS is needed by an aggregator (req. 2(a)) 1 . For this, the subtraction of flexibility Flexibility calculation with non-problematic peak shaving and problematic MPOs. The load forecast is above the peak shaving limit (plot a) during the intervals 2 and 3 without causing a problem. Intervals 0 to 6 have MPOs, three of which derive in planning problems. The PP in interval 1 derives from the lack of energy to comply with the MPO and peak shaving required in intervals 2-3. The PP in interval 3 is caused by peak shaving requiring discharge power from the battery. Thus, a positive MPO can not be fulfilled. Finally, the PP in interval 4 is caused by a lack of energy in the battery, due to the previous peak shaving commitments by already accepted MPOs has to be developed first. As this will be presented in a consecutive work, the test will be presented there as well (see Flexibility calculation). During the first test, it was observed, that Amplify can be calculated in small computation time (req. 2(b)). The second set of tests is used to inspect the correct recognition of PPs (req. 2(c)). Due to the representation of operational flexibility by four vectors, it scales linearly with the number of time intervals of the planning horizon. Thus, a compact representation is satisfied by the design of the model (req. 2(d)).
Assert valid flexibility calculation To perform the first test, we created numerous scenarios by varying the following input parameters of the algorithm: • Physical parameters of the battery: F max s F min s , C E , η s,ch , η s,dis • The current state: F s (0) , t 0 − T 0 , P s,0 (t 0 ), • Application parameters: P max,set peak (i t ) , P fcast (i t ) , F min s,requ (i max t + 1), F max s,requ (i max t + 1) , and the list of MPOs For each of these parameters, we sampled its corresponding range and obtained various values. Using a full factorial experimental design resulted in 933,120 scenarios, for each of which the presented flexibility calculation was performed 2 . The results were then tested regarding the following conditions: • The physical constraints of the battery are respected: • Either the PA (in our case peak shaving) is fulfilled: P max flex (i t ) + P fcast (i t )(i t ) <= P max,set peak (i t )(i t ) or a problem P1.1 or P2.1 is detected. • Either all given discharging MPOs are fulfilled: P max flex (i t ) <= P mpo dis or problem P1.2, P2.1 or P2.2 is detected. • Either all given charging MPOs are respected: P min flex (i t ) >= P mpo ch or problem P1.2 or P2.3 is detected. All tests were executed successfully and a valid flexibility was calculated. On a computer with 16 GB working memory and a processor of 2.3 GHz the mean execution time was 0.00016 s, with a standard deviation of 0.0003 s and a maximum execution time of 0.024 s.
Validate problem detection We tested our presented problem detection algorithm by creating scenarios, in which PPs exist. We calculated the expected PPs in advance and tested whether those are equal to the output of the planning problem detection algorithm. In total, we created 18 different scenarios 3 , with several scenarios for each of the different PPs as well as some scenarios with a combination of different PPs. All tests were executed successfully.
Illustrative scenarios In order to illustrate the results of the flexibility calculation, we applied it to a scenario as presented in Fig. 3. A battery is assumed with an energy capacity of 250 Wh, a maximum battery power of +/− 250 W, and efficiencies of 90 %. Thereby, problems are caused by MPOs conflicting with PS. The results of a full flexibility calculation according to sections Flexibility calculation and Problem handling are presented in the subplots respectively.

Conclusion and outlook
In this paper, we presented Amplify for operational flexibility in multi-purpose use cases of pooled BESSs. The model prioritizes a primary application and provides remaining flexibility for secondary applications, taking into account the operating limits of the BESS. By representing power and energy flexibility, it allows to size MPOs for one or more time intervals. In addition, the model can detect conflicts caused by forecast deviations of related consumers or generators. The envisioned application scenario imposes specific requirements on the flexibility model, concerning multi-purpose use and integration into a swarm of BESSs for collaborative secondary use. Some of the requirements are already met by design, whereas compliance with other requirements was investigated by experimental evaluation. In future work, we want to show how to apply the model to further PAs, such as self-consumption optimization, and evaluate the transfer to other device types.