The Impact of Energy Storage along with the Allocation of RES on the Reduction of Energy Costs Using MILP

: The paper shows a method of optimizing local initiatives in the energy sector, such as energy cooperatives and energy clusters. The aim of optimization is to determine the structure of generation sources and energy storage in order to minimize energy costs. The analysis is carried out for the time horizon of one year, with an hourly increment, taking into account various RES (wind turbines (WT), photovoltaic installations (PV), and biogas power plant (BG)) and loads (residential, commercial, and industrial). Generation sources and loads are characterized by generation/demand proﬁles in order to take into account their variability. The optimization was carried out taking into account the technical aspects of the operation of distribution systems, such as power ﬂows and losses, voltage levels in nodes, and power exchange with the transmission system, and economic aspects, such as capital and ﬁxed and variable operating costs. The method was calculated by sixteen simulation scenarios using Mixed-Integer Linear Programming (MILP).


Introduction
In recent years, there has been a significant development in Renewable Energy Sources (RES) in Poland related to EU policy, which assumes that by 2030, 32% of its total energy will come from this type of generation source. Two types of social energy activities are developing in Poland, aimed at increasing the share of RES in local energy consumption [1]: energy cooperatives and energy clusters. Both energy clusters and energy cooperatives can operate in the area of operation of a single Distribution System Operator (DSO). An important problem related to RES is their nature of work, which is strongly related to weather conditions, which vary throughout the day. Therefore, it is important to properly select the size and type of generating sources by taking into account grid constraints. An additional element improving the functioning of these activities is the appropriate selection of energy storage, which will allow for better control of generation.
Due to the rapid development of RES in the world, many papers on this topic are being written. The first group of articles comprises those that describe the allocation of generation sources in distribution systems with the use of optimization algorithms. In the first paper, Abu-Mouti, F et al. [2] used the ABC algorithm to minimize power losses using allocation and selection of RES power. The minimization of power losses was also presented in two other articles. Prenc, R. et al. [3] presented distributed generation (DG) allocations using genetic algorithms (GA). Kansal, S. et al. achieved [4] the objective function using the PSO technique. Another objective function was presented by Keane, A. et al. [5] and Khalesi, N. et al. [6]. In both articles, the allocation of DG was used with the aim of maximizing the revenues of the distribution companies. In Keane, A. et al.'s paper [5], the goal was achieved with the use of linear programming (LP), while in Khalesi, N. et al.'s paper [6], dynamic programming was used. Kuri, B. [7] used a genetic algorithm to minimize the overall cost. The same objective function was presented by Mashayekh, S. et al. [8]; however, in this article, the authors used Mixed-Integer Linear Programming (MILP).
Another frequently discussed issue in the articles is the appropriate selection and operation of energy storage in cooperation with DG. Energy storage devices reduce the negative impact of atmospheric conditions on generation from RES and its variability during the day and better adjust the generation profile to the demand. In [9], Carpinelli, G. et al. achieved the minimization of total costs by allocating RES and ES using GA. The same objective function was presented by Garcia, R. et al. [10], though LP was used in their article. Kahrobaee, S. et al. [11] used PSO to minimize household energy costs. Malaczek, M. et al. used [12] energy storage together with DG to improve energy quality. Siczek, K. et al. [13] compared Li-S and Li-ion batteries in cooperation with PV.
Another important aspect is Distribution System Expansion Planning (DSEP). MILP was used by Paiva, P. et al. [14] to minimize the cost of losses by building new lines. The same target was presented by Türkay, B. et al. [15], but GA was used in their article. Martins, V. et al. used [16] GA to minimize the costs of building new lines and RES. Vai, V. et al. used [17] the modified sequential switch opening and exchange (MSSOE) solution to optimally change the network configuration.
There are also a number of articles describing how energy cooperatives work. Jasiński, J. et al. presented [18] the strategy of operating energy cooperatives using Mixed-Integer Programming (MIP). Szablicki, M. et al. used [19] the idea of unlimited use of an LV grid by consumers, producers, and prosumers of electricity. On the other hand, Wróbel, J. et al. [20] presented the concept of an exemplary structure of neighboring prosumers based on actual production and consumption profiles.
Two papers written by Andrychowicz, M. [21,22] raise the issue of allocation of RES and ES with the use of MILP, but none of the articles show the impact of these two activities on the costs of energy from renewable sources.

Novelty of the Paper
Although in recent years the topic of the influence of energy storage and RES allocation on the cost of energy has been very popular, no paper has presented a combination of allocation and dimensioning of RES and ES using MILP. Moreover, in this paper, optimization is carried out in an annual time horizon, using the actual production/demand profiles and technical aspects of system operation. All the presented activities allow for a realistic representation of the operation of distribution systems.

Problem Formulation
The problem presented in the article is related to the selection of the power/capacity and location of generating units and energy storage. Optimization is carried out taking into account the technical aspects of the functioning of distribution systems, such as power flows and losses, voltage levels in nodes, and demand profiles of individual recipients located in the analyzed network.

Objective Function
The objective function is expressed as the sum of the annual costs of the analyzed system, including:

Constraints
The technical constraints used in the optimization model include: the share of renewable energy in the total local demand, power flows, power losses, voltage levels in nodes, and the operation of energy storage.
It was assumed that generation from local generation sources minus losses resulting from power flow in the lines must be greater than or equal to its assumed share (k) in the total demand in the analyzed system. The demand depends on the type of reception, its power, and demand profile.
The power flows between nodes depend on the generation and demand in these nodes and are determined for each moment of time.
The power exchange with the transmission system is determined for each moment of time and depends on the balance between generation and demand. It is also assumed that power can only flow from high-to middle-voltage systems in order to minimize the negative impact of renewable energy on the system.
The power losses have been linearized and are represented by the sum of five linear functions. Each function is presented in the Appendix A.
The voltages at any time in each network node must be within the range of 90-110% of the rated voltage of the analyzed system. Those values are required based on distribution network operation and maintenance instructions [23].
The limitations of energy storage relate to the level of charge and losses. The charge level of energy storage must be higher than zero and lower than its rated capacity, which results from the product of the capacity of a single storage unit and the number of storage units in the node. ∀n ∈ N, ∀t ∈ T CL n,t,e ≤ i ES n,e * C ES e (8) ∀n ∈ N, ∀t ∈ T CL n,t,e ≥ 0 (9) The charge level of energy storage units also depends on the losses in energy transmission from the grid to the storage and vice versa.

Assumptions
The analyzed network consists of 11 nodes, of which node 1 represents the 110 kV system and nodes 2 to 11 represent the 30 kV system (Figure 1). It was assumed that in the analyzed system there will be three types of loads (Residential, Commercial, and Industrial), the locations of which are declared. Residential loads are in nodes 2, 3, 7, and 11; commercial loads are in nodes 4, 5, and 6; and industrial loads are in nodes 8, 9, and 10. The research assumed that three technologies are available: wind turbines (WT), photovoltaic panels (PV), and biogas plants (BG). For each of the technologies, three characteristic values of the rated power that a generating unit can have (Table 1) were selected. Moreover, location restrictions were formulated for WT and PV. The lowest capacity units can be installed at residential nodes and the higher capacity generation sources can be allocated to commercial loads, while the highest capacity units can be installed at industrial nodes and at nodes that do not have any loads. Moreover, it was assumed that the total power in one node must be less than 5 MW and that one biogas plant could be located in one node. For technologies dependent on weather conditions (PV and WT), six representative generation profiles were adopted, two (high and low generation) for each season of the year (it was assumed that the profiles for autumn and spring are the same). Data on PV and WT generation were taken from the data of Polish (PSE) and German (TenneT, 50hertz, Amprion, TransnetBW) Transmission System Operators (TSO) [27][28][29][30][31]. It was also assumed that there is one day during the winter when the generation from PV and WT is equal to zero. Due to the nature of the work, it was assumed that BG generation can be variable; however, the capacity factor (CF) must be less than 75% (6600 h). Representative profiles for PV and WT were built based on [32] and are shown in Figures 2 and 3.  For each type of collection (Residential, Commercial, and Industrial), six representative profiles were created. Profiles corresponding to working and non-working days have been created for each season. The data were taken from the Polish DSO [23]. Representative profiles for loads are shown in Figures 4-6.   In order to correlate the representative profiles with the actual PV and WT power factor and the demand profile, it was determined how often a given profile combination occurs during the year.
For each technology, three types of costs were defined: capital costs (overnight), fixed operating costs, and variable costs. Table 2 shows the list of unit costs. It was assumed that two types of energy storage-one with a capacity of 10 kWh and a power of 5 kW for residential and commercial loads and one with a capacity of 250 kWh and 125 kW for industrial loads and the remaining nodes-could be installed. Efficiency of both energy storage and charging was assumed at a level of 0.9. The energy accumulator works in a 24 h cycle; i.e., at the beginning and at the end of the day, the energy accumulator has the same state of charge. Capital costs (overnight) and fixed operating costs of energy storage in relation to capacity are presented in Table 3. Table 3. Costs of ES [33]. Fixed investment and operating costs are determined as costs that must be incurred for the construction of a generating unit per 1 kW of power and of an energy storage unit with capacity. In order to determine the total costs, investment and fixed operating costs are multiplied by the installed capacity of generating units and the capacity of energy storage.

Type of ES Capital Costs [EUR/kWh] Fixed Operating Costs [EUR/kWh]
The model assumes that each investment in an energy-generating unit, energy storage, or new line is covered not only by equity but also by capital from a bank loan. Due to the fact that the model assumes that part of the capital is covered by a bank loan, interest is added to the construction costs calculated on the basis of the Weighted Average of Capital Cost (WACC) resulting from the interest rate on bank loans and the interest rate on equity, which is usually assumed at 1.5 bank interest rate.
Fixed operating costs depend on the rated capacity of the generating units. These costs are independent of the amount of electricity produced and are incurred for: Variable costs of generating units depend on the amount of energy produced. Variable costs include fuel costs and variable operating costs.
The model assumes that the costs do not include the costs of energy storage losses and the costs of energy losses caused by power flows in the lines. These losses are treated as power loss that has to be covered from the generating units installed in the distribution system, which involves the need to install additional sources and the related costs [34].

Simulation
The simulations are carried out on the basis of simulation scenarios that differ from each other in the level of energy from RES and the possibility of building energy storage. The basic division of simulation scenarios is the availability of energy storage that we can build. In the first group of scenarios (ALL), only generation sources can be built, while in the second group (ALL + ES), apart from RES, energy storage can also be built. RES energy levels in both groups were selected from 30% of total consumption in the analyzed system to 100% in 10% increments. Simulation scenarios are shown in Table 4. The purpose of the presented simulations is to show the impact of larger generation from renewable energy sources on the energy mix and the price of energy from renewable energy sources and to illustrate how the construction of energy storage will reduce the cost of energy from RES and how they will affect the energy mix and the capacity factor (CF) of controllable sources (biogas plant).

Results
The results present the structure of installed capacity, energy, capacity of energy storage, and costs of energy generated from local energy sources for the analyzed scenarios. In the Appendix A, there is also shown CF for biogas plants with a different share of renewable energy sources with and without energy storage. Figure 7 shows the capacity structure for each scenario. It can be noticed that with the increase in the share of energy from renewable sources in local demand, the share of biogas plants increases. This is due to the fact that the biogas plant is the most expensive source and is chosen last, but it is one controllable source among the analyzed technologies and also has a power reserve, which is evident in the scenarios where 100% of energy comes from RES. Only biogas plants were built for this scenario. It can also be observed that energy storage can partially fill the power reserve, and thus the share of biogas plants in the power structure is reduced. It can also be seen that in the scenarios with ES, the installed capacity is higher than in the scenarios with RES allocation only. This is due to the fact that ES allows the reduction of energy from biogas plants by replacing this energy with PV and WT, whose CF is much smaller, which results in the need to build sources of greater power.  Figure 8 shows the energy structure for each scenario. It can be seen that, as for the installed capacity, energy storage reduces the share of energy from the biogas plant, which is the most expensive in the total energy mix. Comparing Figures 8 and 9, it can be seen that for the scenario with 100% share of energy from RES in local demand, the capacity factor increases from 64% (scenarios without ES) to 70% for the scenario with ES.  As can be seen from Figure 9, energy storage is installed only from the scenario in which 40% of energy comes from RES. This is due to the fact that energy storage devices are the most effective for situations where power reserve sources are needed, and in this situation, the energy storage can perform this function. It can also be seen that there is a big increase in the capacity of the energy storage in the last scenario. Thanks to the use of energy storage devices, it is possible to avoid building some of the generating sources serving as a power reserve (Figure 7). Figure 10 shows that with the increase in the share of RES, the cost of energy increases. This is due to the fact that with the increase in the share of energy from local sources, there is a need to install more capacity from more expensive sources (PV and BG) in order to better match the generation profile to the demand. It is possible to obtain a lower energy price (3.8% on average) by using energy storage.

Conclusions
Due to EU policy, which assumes a greater share of RES in the total generation, various local initiatives are supported, such as energy cooperatives and energy clusters. One of the characteristic features of renewable sources is their variability of generation and dependence on weather conditions. Taking this into account, there is a need for mechanisms allowing for the appropriate selection of generation sources in order to ensure continuity of energy supply and to minimize energy costs. Additional elements that are important in the development of local initiatives in the energy sector are the appropriate development of distribution networks and the allocation of energy storage.
The results show the impact of the allocation and selection of the capacity of energy storage in conjunction with the allocation and selection of the power of generating sources. Based on the analyses, it can be concluded that with the increase in the power of wind sources and photovoltaic installations, there is a need to build sources whose generation can be controlled (e.g., biogas plants) or to build energy storage. Additionally, adding the allocation of energy storage to the allocation of RES results in the need to build generation sources with a lower total installed capacity and causes a reduction in the costs of energy production from RES in the range of 1.71% to 7.35%, assuming an appropriate level of generation in relation to local demand. In the case of the scenarios with ES, the installed capacity is greater than in the scenarios with RES allocation only. This is due to the fact that ES allows the reduction of energy from biogas plants by replacing this energy with PV and WT, whose CF is much smaller, which results in the need to build sources of greater power. However, despite the greater total installed capacity, energy is cheaper because it is produced to a greater proportion from PV and WT, the costs of which are much lower. Moreover, ES allows CF for biogas plants to be increased by up to 9.8% for the scenario with the share of RES at the level of 100%. binary variable that determines whether a given "s" line will arise between the "n" and "w" nodes p toES n,t,e power which flow from grid to energy storage in node n in time t p f romES n,t,e power which flow from energy storage to grid in node n in time t Acronyms WT wind turbine PV photovoltaic installation BG biogas power plant RES renewable energy sources ES energy storages GD grid development ∀ t ∈ T ∀ n, w ∈ N f 4 n,w,s,t = 0.4 * Constr. line n,w,s * R n,w * D n,w U 2 * PF n,w,t − 0.24 * Constr. line n,w,s 2 * R n,w * D n,w U 2 (A4) ∀ t ∈ T ∀ n, w ∈ N f 5 n,w,s,t = 0.4 * Constr. line n,w,s * R n,w * D n,w U 2 * PF n,w,t − 0.32 * Constr. line n,w,s 2 * R n,w * D n,w U 2 (A5) Figure A1. Power losses linearization-spline function consisting of five linear functions.