Full text
Research article A production-inventory model to optimize the operation of distributed energy resource networks in a rolling horizon Pablo Cort´ es 1,* , Alejandro Escudero-Santana 1 , Elena Barbadilla-Martin 1 , Jos´ e Guadix 1 Ingeniería de Organizaci´ on, Escuela T´ ecnica Superior de Ingeniería, Universidad de Sevilla, Camino de los Descubrimientos s/n, 41092, Sevilla, Spain ARTICLE INFO Keywords: Mixed-integer linear programming Distributed energy resource Renewable energy source Production Inventory Rolling horizon ABSTRACT.- The recent advancements in energy production, storage, and distribution are creating unprecedented opportunities in the field. Major consumers can benefit from the implementation of distributed energy resource networks capable of generating electricity or heating from sources, often renewable ones, in close proximity to the point of use, rather than relying on centralized generation sources from power plants. In this paper, we introduce a pioneering model designed to determine the optimal set of energy commands in a distributed energy resource network, minimizing operational costs in a time horizon. Indeed, we propose an innovative mixed-integer linear programming formulation rooted in the production-inventory models commonly employed in aggregate production planning. The system integrates diverse energy generation sources, storage facilities, and demand points, encompassing both electric and heating commodities. The optimum of the model is achieved for all analyzed instances of the test library (2 scenarios-20 instances) in an exceptionally short time, outperforming other approaches previously presented in the literature. We employed the Gurobi optimizer to solve the model, obtaining rapid responses that ensure real-time decision-making and facilitate effective control of the distributed energy resource network within a three-days’ rolling horizon, as discussed in a simulated real-life application case study. Indeed, the proposed model solves in less than 1 s, enabling near-instantaneous decisionmaking. This swift solution time surpasses any known references in the field, effectively shifting the bottleneck in DER network operation from the decision-making process to the forecasting of demand and weather conditions. While forecasting typically requires a minimum of 15 min, our approach suggests that a reduction in this forecasting time could further enhance the control system’s response time, given the model’s ability to deliver optimal solutions almost immediately. The real-time availability of optimal solutions allows for the seamless incorporation of stochastic elements into the control loop via a rolling horizon process. * Corresponding author. E-mail address: [email protected] (P. Cort´ es). 1 This paper presents the work conducted within the project CONFOrt t´ ermico a trav´ es del modelo adaptativo para edificios RESilientes (Ref.: TED2021-130659B-I00), funded by the Ministerio de Ciencia e Innovaci´ on under the Proyectos de Transici´ on Ecol´ ogica y Transici´ on Digital program. Contents lists available at ScienceDirect Heliyon journal homepage: www.cell.com/heliyon https://doi.org/10.1016/j.heliyon.2024.e39900 Received 13 May 2024; Received in revised form 22 October 2024; Accepted 25 October 2024 Heliyon 10 (2024) e39900 Available online 30 October 2024 2405-8440/© 2024 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ ).
1. Introduction The complexities surrounding energy production, storage, and distribution represent a significant challenge on the horizon [1–3]. The emergence of intelligent networks, capable of identifying the most effective methods for energy generation, coupled with the potential for efficient energy storage, has become a key aspect at both urban and building scales [4,5]. These advancements are set to play a crucial role in molding the energy scenario of the near future, where progress in clean energy technologies and achieving carbon neutrality under resource constraints are essential goals [6,7]. In this context, the energy cost is a growing and significant factor for large energy consumers. Meanwhile energy costs are increasing, distributed generation costs are progressively being reduced. In this line, the term distributed generation arises as an energy cost saving opportunity [8,9]. It relates to the possibility of generating electricity or heating from sources, often-renewable energy sources, near the point of use instead of centralized generation sources from power plants. Distributed Energy Resources (DER) refers to often-smaller generation units that are located on the consumer’s side of the meter and can include energy generation and energy storage capabilities. In fact, self-consumption emerges as an actual possibility to reduce the energy costs of large consumers using alternative distributed energy generation sources such as cogeneration and other renewable energy systems (RES) such as solar (thermal or photovoltaic) or wind (see Ref. [10] for an analysis about payback of the required investments in DER scenarios or [11] for a discussion on efficiency in wind energy generation optimization). For all these reasons, Distributed Energy Resource networks emerge as a key opportunity in the new paradigms based on sustainability and energy self-sufficiency. However, the combination of complex energy resources, their different modes of operation, and how they must supply the required energy from the demand side faces new and emerging challenges and requires the design of models capable of performing this task efficiently and optimally, allowing for economically viable operation. The objective of our paper is to develop a control scheme for a Distributed Energy Resource network using a mathematical programming model that optimizes the cost-effective operation of DER networks. This model provides an optimal combination of energy resources for the control system of the DER network, enabling real-time control in response to changes in energy demand and weather conditions through quick modelsolving response times via a rolling horizon approach. The remainder of the paper proceeds with a literature review on modeling DER network operation, followed by a discussion in Section 2on how our research advances beyond the current state of the art. Then the specific characterization of the problem is presented in Section 3, providing a comprehensive overview. Following that, Section 4presents the mixed-integer linear programming model, employing the previously introduced production-inventory paradigm, providing insights into the formulation. Section 5is dedicated to the computational experimentation, contrasting it with other previous approaches. This section also features a case study that illustrates the performance of the control system, paying special attention to the energy systems’ commands along the rolling horizon and how the control systems is able to respond to variations in the expected forecasts. Finally, Section 6brings the main conclusions from the research, summarizing the key findings and remarking the contributions. 2. Literature review and progress beyond the state of the art Distributed Energy Resource networks can involve a wide variety of energy systems. Considering different combinations of such equipment can increase the complexity of modeling and complicate the process of achieving near real-time optimal operation of the various energy resources. In this line, cogeneration and storage energy systems are of a pivotal relevance when modelling such networks. So, the use cogeneration can couple different energy networks (such as electric and heating), while storage systems enable the use of energy generated in earlier periods to meet demands in subsequent periods. In scenarios where electric and heating networks coexist, cogeneration emerges as a significant element by effectively coupling both systems. Cogeneration is mainly produced by Combined Heat and Power (CHP) systems, which the capability of simultaneous generation of thermal and electric energy. CHP systems are distinguished by their acknowledged energy efficiency, low environmental emissions, and a certain level of autonomy from centralized power grids. These systems demonstrate the capability to generate electric energy while simultaneously harnessing thermal energy from typically discarded sources, thereby contributing to efficient heating processes [12]. Additionally, energy storage systems such as electric batteries or thermal storage can be adequately used to contribute to reduce the purchase of energy grid during those peak periods with higher prices of the energy. Indeed, the efficiency of modern electric batteries currently allows for the effective decoupling of production and demand concepts. This enables the production of energy during periods when the costs of electricity production or acquisition are lower, or when weather conditions favor higher production yields from RES. Subsequently, this stored energy can be consumed during periods of higher demand, which often coincide with more expensive pricing intervals or when energy production from RES is no longer feasible, see Ref. [13] for an economic analysis on the viability of the electric batteries in an office building. On the other hand, technological advancements in thermal storage have also been enabling a more efficient utilization of this storage capacity at the level of heating networks [14] constituting and adequate approach to decoupling production and demand in heating networks. Therefore, a large consumer implementing a comprehensive Distributed Energy Resource network to meet both electric and heating demands would operate an electric network capable of serving the building’s electricity needs through various sources, which could include the electric grid, a Combined Heat and Power (CHP) system, renewable sources (such as photovoltaic and wind power), and electric batteries. Additionally, the system would include a heating network designed to meet the building’s heating needs using boilers, CHP, renewable sources (like solar thermal), and thermal storage. The coupling of the electric and heating networks occurs through the CHP system, which concurrently supplies electric energy and heating. The primary objective is to strategically choose the optimal configuration of systems to meet both energy demands while minimizing costs for each considered instant of time. To do so we P. Cort´ es et al. Heliyon 10 (2024) e39900 2
implement a mathematical programming approach by designing a novel mixed-integer linear programming model able to provide a quick and optimal solution each instant of time it is required. The application of mathematical programming models to address energy generation and storage problems has garnered considerable attention in the scientific literature. First, there is a set of research papers employing mixed-integer linear programming models to assess the optimality of investment decisions in energy systems, as demonstrated by several authors [15,16]. It corresponds to an analysis from the operator’s perspective (supply side). There is a second set of research papers that focus on using mathematical programming models to optimize operational decisions within the energy network, specifically on how a large consumer can meet its energy demands while minimizing the operating costs of its DER network. It corresponds to an analysis from the customer’s perspective (demand side). Our paper falls in this set of the scientific literature. Many studies have focused on designing models to optimize total heat and electricity production in a CHP system [17], and even on expanding the cogeneration concept to trigeneration by including cold production [18]. Along similar lines, large cogeneration systems for district heating have also been studied using mathematical programming models [19]. A significant contribution in this area is the use of mathematical models based on flow formulations by Refs. [20,21]. Their research developed flow formulations to model coupled electric and heating energy networks, incorporating a CHP system, boilers, and the electric grid. Moreover, the consideration of various energy generation systems, particularly renewable energy sources, has been addressed by optimizing their contribution to energy generation through a multi-objective mathematical programming model, although their network did not include cogeneration systems [22]. In other line, the consideration of energy storage systems together with RES was addressed by Ref. [23], although their work did not considered cogeneration systems. However, all these prior research works shared a common focus on networks with a limited number of energy production systems and did not consider cogeneration and energy storage equipment together, which significantly complicates network operation. In fact, most of the studies tend to focus predominantly on the generation of optimal set-points for the case of the CHP system without considering the holistic view provided by an extended distributed energy resources network including generation and storage capabilities. However, they often overlook the holistic perspective provided by a full distributed energy resources network including both generation and storage capabilities. Actually, there are not many papers dealing with a full comprehensive DER network. One of the first studies that considered a more comprehensive network that encompasses a broader spectrum of energy systems, including CHP, RES and energy storage systems was presented in the works [24,25]. Their proposal incorporated initialization costs by using binary variables, converting the problem into a mixed-integer non-linear programming model while still employing a flow formulation. Both papers proposed a deterministic approach capable of providing an efficient solution every 15 min, which was novel at the time. The adoption of metaheuristics, such as genetic algorithms, proved effective in generating promising solutions, although without the guarantee of optimality. However, they did not account for possible variations in the demand curve or RES forecasting. This limitation can be addressed by considering stochastic programming, as seen in Refs. [26,27], although the stochastic nature of Fig. 1. Conceptual architecture of the global system. P. Cort´ es et al. Heliyon 10 (2024) e39900 3
these models results in an operating response time of about an hour, quadrupling the response time observed in Refs. [24,25]. In our research, we address a comprehensive Distributed Energy Resource network, as illustrated in Fig. 1, which includes Combined Heat and Power systems, boilers, Renewable Energy Source systems (photovoltaic, solar thermal and wind energy), and energy storage systems such as batteries and thermal storage. Additionally, our approach aims to overcome the limitations identified in previous studies by introducing a novel and simplified mixed-integer linear programming formulation adapted from the productioninventory models commonly used in aggregate production planning (see Ref. [28] for a review for the case of multi-factory production networks and [29–31] for an in depth review on production-inventory formulations). The formulation considers two different commodities in the network: the electric and heating energy. In this context, the multi-period energy demand for each commodity can be fulfilled either from a set of energy generation nodes (analogous to the multi-factory concept in production planning) or from the existing energy storage nodes (equivalent to the inventory concept in production planning). Table 1 provides a comparison between the reviewed literature and our approach. The comparison covers the scope of the DER network (the energy systems considered), the modeling approach, the solving procedure, the optimum certainty in the solution provided by the solving procedure, the optimization period and the limitations that our approach seeks to address progressing beyond the state of the art. The main contributions of our paper can be inferred from Table 1 and are highlighted below. Table 1 Summary of the literature review and progress beyond the state of art. Reference Problem and approach characteristics Progress beyond the state of the art [17] DER network: CHP DER network: Our proposed full DER network a considers of a full DER network including CHP, RES (photovoltaic, solar thermal and wind energy generation), boiler, electric grid, batteries and thermal storage. This configuration surpasses previous studies such as [17–19], which focused solely on cogeneration-type configurations; [20,21], which integrated CHP with boilers and the grid; [22], which considered RES alongside gas engines and the grid; and [23], which examined energy storage and RES without incorporating CHP systems that couple electric and heating networks. Problem solving time and optimization period: The problem-solving time in our approach is under 1 s. However, we selected an optimization period of 15 min, as recalculations based on weather and demand forecasts typically require more time than mere seconds. In comparison, prior models combined with their respective approaches [17,18,20–23] achieved solution times on the order of 1 h, and approach [19] required up to a week to converge. Formulation: Linear Programming Solving approach: Simplex Algorithm Optimum achievement certainty: Yes Optimization period: Hour [18] DER network: Trigeneration Formulation: Linear Programming Solving approach: Simplex Algorithm Optimum achievement certainty: Yes Optimization period: Hour [19] DER network: CHP Formulation: Mixed Integer Linear Programming Solving approach: GAMS/CPLEX optimizer combined to Lagrangian relaxation Optimum achievement certainty: Yes Optimization period: Week [20,21] DER network: CHP, boiler, grid Formulation: Mixed Integer Linear Programming Solving approach: LP solver Optimum achievement certainty: Yes Optimization period: Hour [22] DER network: RES, electric grid, gas engine Formulation: Multi-objective Linear Programming Solving approach: LINGO optimizer Optimum achievement certainty: Yes Optimization period: Hour [23] DER network: RES, energy storage Formulation: Mixed Integer Linear Programming Solving approach: Metaheuristics (PSO) Optimum achievement certainty: Yes Optimization period: Hour [24,25] DER network: Full DER network a Optimum achievement certainty: Our approach guarantees certainty in the model optimum achievement at difference from Refs. [24–27]. Problem solving time and optimization period: The problem-solving time in our approach is under 1 s. However, we selected an optimization period of 15 min, as recalculations based on weather and demand forecasts typically require more time than mere seconds. In comparison, prior models combined with their respective approaches as [24,25] achieved solution times on the order of several minutes, meanwhile [26] achieved solution times on the order of 1 h, and [27] did not provide information regarding solving time. Formulation: Mixed Integer Non-linear program. Solving approach: Metaheuristics (GA/PSO) Optimum achievement certainty: No Optimization period: 15 min [26] DER network: Full DER network a Formulation: Stochastic programming Solving approach: Metaheuristics (LSA) Optimum achievement certainty: No Optimization period: Hour [27] DER network: Full DER network a Formulation: Stochastic programming Solving approach: Heuristic and GAMS optimizer Optimum achievement certainty: No Optimization period: Hour a Full DER network includes CHP, boiler, electric grid, RES, thermal and electric storage. P. Cort´ es et al. Heliyon 10 (2024) e39900 4
⁃ To the best of our knowledge, the use of a mixed-integer linear programming model integrating production and inventory concepts for optimizing the operation of a Distributed Energy Resource network has not been explored in the scientific literature before. The elegance of this formulation lies in its ability to efficiently address the complexities of DER network optimization providing optimal solutions in short time lapse. ⁃ The time required to solve the proposed model is less than 1 s, allowing for optimal decisions to be made in a very short period. It has to be noted that we are not aware of any previous references capable of providing a solution in such a short amount of time. This means that the bottleneck in the control system for DER network operation is not the decision-making process regarding which systems should supply energy, but rather the forecasting of changes in demand or weather conditions affecting the RES. Since this type of forecasting typically requires at least 15 min, we maintained this time interval. However, if the forecasting period could be shortened, the control system’s response time could also be reduced, as our approach can deliver the optimal solution in about 1 s. ⁃ The availability of an optimal solution in real time (with a solving time of less than 1 s) enables the incorporation of stochasticity into the control loop through a rolling horizon process, by continuously updating forecasts related to demand or weather conditions that affect the energy production of RES. Using a MILP model allows us to obtain the optimum every second, rather than relying on approximate solutions derived from stochastic models. 3. The problem The problem revolves around identifying the most cost-effective approach to meet the electricity and heating demands of a large energy consumer over a day discretized into periods (t =1, 2, …|T|). This consumer has various options for fulfilling their demand. Specifically, electricity can be procured directly from the grid, sourced from renewable energy, or generated through a combined heat and power system. Similarly, heating can be obtained from a thermal solar renewable system, a boiler, or the CHP system. Additionally, the consumer is equipped with batteries to store excess electricity and thermal storage systems to retain surplus heat. In the event of producing excess electricity that cannot be stored in the batteries, the consumer has the option to sell it to the market at a specified market price. Fig. 1 represents the described architecture and the ways that a large consumer can proceed to meet the electric and heating demand it generates from the sources described above. The figure uses different colors to represent various energy sources and components. Blue color is used for electric energy sources, including the electric grid (top left), Renewable Energy Sources (RES) such as photovoltaic and wind energy (under the grid), and batteries (center top). Magenta color represents the CHP system, located in the center left of the figure. Orange color is used for heating energy sources, including the thermal solar system and boiler (bottom left) and thermal storage (bottom center). Electric and heating energy flows are indicated by arrows following the same color scheme. On the right side of the figure, the large consumer box is shown along with the market (in blue), where excess electric energy can be sold, and a final box indicating excess heating that is not recovered and is therefore wasted (in orange). This architecture can be represented as a pair of networks coupled by the presence of the CHP (represented in magenta color at Fig. 1), which participates in both blue colored electric and orange colored heating networks. Fig. 2. Distributed energy resource control system (DERCS). P. Cort´ es et al. Heliyon 10 (2024) e39900 5
To meet the energy demand of the large consumer, the entire system relies on a control system operating within a rolling horizon over discrete periods (t ={1, 2, …, |T|}). Fig. 2 outlines the concept of a Distributed Energy Resource Control System (DERCS). At each time period, updated weather and energy demand forecasts, and the status of storage facilities (batteries and thermal storage) are provided. These data, combined with the cost repository, are input into the optimizer engine to determine energy commands for each energy generation source and storage facility. One of the aims of the control system is to be able to provide new commands in a time period as short as possible, focusing its performance to a real-time control system. To attain such objective the optimizer needs to provide the solution as quick as possible. The system operates within a rolling horizon framework. In each period, t, the optimizer is tasked with solving the problem for the subsequent t to t+|T| periods. However, the commands generated are just applied only to the immediate period, t. This is because, in the following period, t+1, a new calculation, incorporating updated weather and demand forecasts, is conducted for the subsequent t+1 to t+|T|+1 periods. The commands for this newly calculated horizon are then implemented in the next period, and this process iterates accordingly. 4. The production inventory model In this section, we present a mixed integer linear programming optimization model based on a production-inventory optimization model. This model constitutes the core of the control system described in Fig. 2. To define the model, a graph structure is conceptualized by nodes set as production sources and demand, as well as inventory processes as described before. Firstly, it is important to highlight that Fig. 1 illustrates a pair of energy networks: an electric energy network and a heating network interconnected through the presence of the Combined Heat and Power (CHP) system. This intricate configuration can be mathematically formulated as a complex problem involving multiple production sources, demand points, inventories, and capacitated arcs spanning a temporal horizon. Fig. 3 visually represents such a model. The graphs on the left (a) depict two distinct graphs, each representing a single commodity. We have used the same color convention as in Fig. 1: the blue network corresponds to the electric network, while the orange network represents the thermal network. The CHP (magenta color) serves as a coupling element between both networks by producing electric and thermal flows supplied from the gas grid. In Fig. 3, side (a), on the left-hand side, the energy sources and the arcs associated with the generated energy flows are depicted. The variables x jt on the arcs represent the flows supplied by source j in period t, where K jt signifies the capacity of the arc, indicating the maximum energy level that the source can supply (e.g., in the case of RES, it depends on wind or insolation forecasting). On the righthand side, the representation includes the required demands (D t ) and the excess energy being produced (e t ), along with inventory processes from one period t to the next (t+1). The variables I t represent the level of stored energy at the end of period t, dependent on each energy network (batteries or thermal storage), and IM represents the maximum storage capacity. Nevertheless, these two networks can be jointly addressed by considering a multicommodity flow graph, specified by the subindex Fig. 3. Production-inventory graph with multiple production sources and capacitated arcs. P. Cort´ es et al. Heliyon 10 (2024) e39900 6
k, where k =1, 2 (with k =1 denoting electric flows and k =2 indicating thermal flows). Fig. 3, side (b), illustrates the multicommodity network in black. Each energy system contributes one single commodity flow, except for the CHP, which supplies both commodity flows. In this scenario, the variables x jkt on the arcs represent the flow supplied by source j of commodity k in period t, with K jkt denoting the corresponding capacity. Similarly, I kt signifies the level of stored energy of commodity k at the end of period t, and IM k represents the maximum storage capacity for such commodity in the corresponding storage system. The outlined problem can be conceptualized as an inventory-production problem involving multicommodity flows, incorporating multiple production sources, inventories, and capacitated arcs to fulfill a predetermined demand within a given temporal horizon. One relevant issue that needs some discussion concerns the inventory nodes, namely the electric batteries and the thermal storage systems. In a long-term analysis, such systems should account for round-trip efficiency losses, as discussed by Ref. [32]. However, over a short-term period (e.g., within a few weeks horizon), these efficiency losses can be disregarded as they are relatively minor. Therefore, given the horizon analyzed in our paper and our primary focus on a simple and easy-to-implement model, we chose not to incorporate round-trip efficiency losses into our model. A final important aspect of the model concerns the performance of each energy system. This can be seen graphically in Fig. 4, where the raw energy entering the system results in some energy losses, yielding a net energy flow. This phenomenon necessitates a specific formulation, which is captured through additional constraints in the model. After discussing the main details and conditions of the problem, Table 2 presents the sets, variables (both continuous and binary decision variables), and input data to be considered. These elements collectively enable the formulation of the constraints and the objective function of the model. Once the notation is introduced, we present the Production Inventory Model (PIM) next, which is described as a mixed-integer linear programming model. Min Z =∑ t∈T(∑ k∈K(∑ j∈J\{1} Fj⋅ajkt +∑ j∈J\S Cjt ⋅xjkt +Sk⋅bkt +Vk⋅(ukt +vkt))+∑ j∈S Cjt ⋅gjt −Pt⋅e1t)(1) subject to: Ik,t−1+∑ j∈J xjkt =Dkt +ekt +Ikt ;∀k∈K,∀t∈T(2) Ikt −Ik,t−1=ukt −vkt ;∀k∈K,∀t∈T(3) Fig. 4. Performance at the energy systems. P. Cort´ es et al. Heliyon 10 (2024) e39900 7
ukt ≥ ρ k(∑ j∈J xjkt −Dkt −ekt);∀k∈K,∀t∈T(4) vkt ≥Dkt +ekt −∑ j∈J xjkt ;∀k∈K,∀t∈T(5) ukt +vkt ≤UBk⋅zkt ;∀k∈K,∀t∈T(6) bkt ≥zkt −zk,t−1;∀k∈K,∀t∈T(7) Ikt ≤IMk;∀k∈K,∀t∈T(8) LBjkt⋅yjkt ≤xjkt ≤Kjkt ⋅yjkt ;∀j∈J\ {1},∀k∈K,∀t∈T(9) ajkt ≥yjkt −yjk,t−1;∀j∈J\ {1},∀k∈K,∀t∈T(10) xjkt = η jk ⋅gjt ;∀j∈S,∀k∈K,∀t∈T(11) xjkt,ajkt ≥0,∀j∈J,∀k∈K,∀t∈T(12) gjt ≥0,∀j∈S,∀t∈T(13) Ikt,ukt,vkt,bkt,ekt ≥0,∀k∈K,∀t∈T(14) Table 2 Notation. Sets J Set of energy generation sources, being j ∈J; J ={1, 2, …, j, …,|J|}. We reserve the value j =1 for the electric grid. S Set of thermal energy generation sources constituted by the CHP (2) and the boiler (3), being s ∈S; S ={2, 3} K Set of commodities: electricity and heating, being k ∈K; K ={1, 2}, being k =1 the electricity and k =2 the thermal energy. T Temporal horizon, being t ∈T; T ={1, 2, …, t, …,|T|} Variables xjkt Flow of generated energy of type k by source j in period t. It is a continuous non-negative variable. Ikt Level of stored energy of type k at the end of period t. It is a continuous non-negative variable. ukt Amount of energy that is charged at the storage facility of type k energy in the period t. It consequently increases the level of type k energy that is stored. It is a continuous non-negative variable. vkt Amount of energy that is discharged from the storage facility of type k energy to be supplied to the building installation in the period t. It consequently decreases the level of type k energy that is stored. It is a continuous non-negative variable. gjt Amount of gas acquired to the gas grid provider with destination the energy generation source j (corresponding to the boiler or the CHP) in period t. It is a continuous non-negative variable. ekt Excess of energy of type k that is generated in period t to be sold (in case of electricity) or to be wasted in case of heating (that should be zero in case of optimality). It is a continuous non-negative variable. yjkt Binary variable. It takes vale equal to 1 in case of the energy generation source j is activated to supply type k energy in period t, and 0 otherwise. This variable is considered ∀j ∈J\{1} ajkt Continuous variable that takes a value equal to 1 in case of the energy generation source j is initialized to supply type k energy in period t, and 0 otherwise. This variable is considered ∀j ∈J\{1} zkt Binary variable. It takes vale equal to 1 in case of the storage facility of type k energy is activated in period t, and 0 otherwise. bkt Continuous variable that takes a value equal to 1 in case of the storage facility of type k energy is initialized in period t, and 0 otherwise. Data Dkt Demand of type k energy in period t Kjkt Capacity of the energy generation source j ∈J\{1}, related to type k energy, in period t. In case of RES it will depend on the weather forecasting and the corresponding performance of the RES system. In case of the electric grid, it is considered as a non-limited supply. LBjkt Minimum energy flow (lower bound) that can be provided by the energy generation source j ∈J\{1}, related to type k energy, in period t. IMkIt represents the maximum storage capacity for such commodity in the corresponding storage system (battery or thermal storage). UBkIt represents the maximum flow (upper bound) of type k energy that can be charged/discharged by the corresponding storage system (battery or thermal storage) during the period t. η jk It represents the performance of the energy generation source j to produce type energy k. The CHP is the only system able to produce energy for both networks. The performance at the CHP and boiler depends on higher heating value (HHV) and the lower heating value (LHV) of the incoming gas, as well as the equivalent electric performance. The performance of the electric grid is equal to 1. ρ kIt represents the performance of the type k energy storage system. FjFixed cost of initializing the energy generation source j. Cjt Variable cost that depends on the amount of energy required by the source j in period t. In case of the RES, this value will be zero. In case of the CHP and the boiler include the use of the equipment and the gas price; it will depend on the amount of gas acquired. In case of the grid, it will depend on the amount of electricity that is bought and it will strongly depend on the period. SkFixed cost of initializing the type k energy storage facility to charge or discharge energy. VkVariable cost of using the type k energy storage facility that depends on the amount of energy to be charged or discharged. PtSelling price of electricity to the grid in period t. P. Cort´ es et al. Heliyon 10 (2024) e39900 8
yjkt = {0,1},∀j∈J,∀k∈K,∀t∈T(15) zkt = {0,1},∀k∈K,∀t∈T(16) Ik0,yjk0,zk0given (17) Equation (1) corresponds to the objective function, aiming to minimize the total operational costs. These costs encompass both the fixed costs associated with initiating the energy generation sources and storage facilities, as well as the variable operational costs. The objective function also takes into account income generated from electricity sales to the grid provider. Equation (2) corresponds to the energy balance equation. It states that the total amount of type k energy generated by the type k energy generation sources in period t, along with the amount of type k energy stored at the beginning of the period, must be equal to the demand for type k energy, plus the excess of generated type k energy, and the type k energy stored at the end of the period. Equations (2) and (3) corresponds to the graphical description of Fig. 3. The set of constraints (3-8) regulate the operation of the storage facilities. Equation (3) states that the difference between the type k energy stored at the end and the beginning of period t equals the energy charged minus the energy discharged at the storage facility during the period. It is important to note that if ukt >0 then vkt =0 and vice versa, as both terms are penalized in the objective function (1). Constraints (4) and (5) determine the minimum value for ukt and vkt, respectively. On the one hand, the type k energy storage facility is charged (ukt) during the period t if the amount of type k energy generated exceeds the type k energy demanded plus the excess of type k energy generated. This amount is adjusted based on the performance of the storage facility during the charging process. On the other hand, the type k energy storage facility is discharged (vkt) during period t if the amount of type k energy generated is less than the type k energy demanded plus the excess of type k energy generated. These equations (4) and (5) are graphically described in Fig. 4. Constraint (6) activates the binary variable zkt if the storage facility is engaged in a charging or discharging process during period t. The equation also states that the maximum flow to be charged/discharged is given by UBk. Additionally, constraint (7) determines if the storage facility is initialized in period t. Note that it takes the minimum possible valuable since it is penalized in the objective function (i.e. a value equal to 1 if zkt =1 and zk,t−1=0, and otherwise 0. Moreover, constraint (8) determines that the amount of type k energy in the storage facility cannot exceed the capacity of the battery (k =1) or the thermal storage (k =2). Constraints (9) to (11) regulate the supplies from the energy sources and are restricted by the arc capacities. Constraint (9) activates the binary variable yjkt if the type k energy generation source is active in period t, limiting both the maximum and minimum levels of energy flow provided. The value of Kjkt depends on the weather forecasting and the corresponding performance in case of the RES system. For the CHP and boiler, the capacity depends on the maximum flow that the equipment can produce (both electric and thermal energy in the case of the CHP during its operation), as well as it depends on the amount of energy acquired to the grid provider. There is no binary variable associated to the electric grid activation since it is always available and active. Constraint (10) determines if the type k energy generation source is initialized in period t. Note that it takes the minimum possible value, as it is penalized in the objective function (i.e. a value equal to 1 if yjkt =1 and yjk,t−1=0, and otherwise 0. Equation (11) relates to the gas acquisition from the grid provider. In the case of generating type k energy at the CHP or boiler, the amount that can be generated depends on the amount of gas acquired from the gas grid provider, adjusted by the performance of the equipment. Note that the CHP generates both electric and thermal energy. This equation appears graphically described in Fig. 4. Finally, specifications from (12) to (17) state the feasible values for continuous variables (non-negative), declare binary variables, and provide the initial conditions for the activation of energy sources and storage facilities, as well as the level of charge of the storage facilities. 5. Experimentation: the optimizer and the distributed energy resource control system This section is devoted to the analysis of the operation of the Distributed Energy Resource Control System and the optimizer that enables the appropriate performance of the whole system. Indeed, the optimizer represents the core component of the DERCS control loop illustrated in Fig. 2 and it provides the optimal solution for the Production-Inventory model (PIM) outlined in Section 3. We selected Gurobi optimization software to solve the PIM model. This solver has been developed by Gurobi Optimization, LLC, and it stands as a prescriptive analytics platform and decision-making technology that integrates exact mathematical methods for optimization, and that has been identified as a suitable tool for addressing diverse energy system problems, as extensively explored in Ref. [33]. Additionally, the Institute for Operations Research and the Management Sciences (INFORMS) that is an international society for practitioners in the fields of operations research, management science, and analytics makes a yearly optimization software survey (whose 2023 edition can be found at the website https://pubsonline.informs.org/magazine/orms-today/2023-optimization-software- survey). The survey identifies Gurobi as a suitable optimization software for mixed-integer linear programming models, and it is among the most recommended optimization tools. Beyond its traditional and widely-used APIs (compatible with C, C++, .NET, Python and Java), the Gurobi solver can be integrated with various third-party modeling frameworks, including GAMS, AMPL, Pyomo, and Julia/JuMP. Additionally, Gurobi is capable of solving a wide range of problems to optimality, from linear programming and mixed-integer programming to mixed-integer non-convex quadratically constrained quadratic problems. The choice of this software is also influenced by its availability for free use in university research development. To assess the effectiveness of the proposed approach, we conduct a thorough evaluation by comparing the outcomes obtained through the optimization of the Production-Inventory model against the metaheuristic approaches presented at [24]. We selected this P. Cort´ es et al. Heliyon 10 (2024) e39900 9
The third comparison scenario is constructed to analyze how the DERCS adapts the provided commands when a modification in the electric and heating demands is detected in the large consumer installation. In this new scenario, after the first day, an increase in the electric and heating demands is detected, and it is assessed as 20 % higher for both (see Fig. 9 for graphical details). This new demand forecast is included at 0:00 on day 2 (period 96). Fig. 12 reveals the adjustment in the commands provided by the DERCS. In the base scenario, the optimal solution consisted of using the grid for the electric demand and the boiler for the heating demand. However, when both demands are increased by 20 %, the DERCS modifies the commands, centering the approach on providing both energies (electric and heating) by using the CHP, which can provide both energies within its operation, reducing the use of the electric grid and eliminating the use of the boiler. Indeed, this situation allows starting the CHP to economically offset its initialization costs, and the provision of heating and electricity helps reduce grid usage and eliminates the need for the boiler reducing its cost to zero. This effect can be observed for days 2 and 3 (from period 131 onward) in next Fig. 12. The analysis of all these scenarios allows us to confirm that the DERCS responds adequately to variations in the forecasted input data and the optimizer can provide quick optimal responses, delivering new energy commands in an efficient way. After completing the comprehensive analysis in this experimentation section, it is important to note the managerial insights derived from the full methodological approach proposed in our paper. The PIM model represents a significant methodological advancement in the control of Distributed Energy Resource (DER) networks, offering a robust tool for managers of large energy consumers to optimize DER operations and achieve cost savings. The model’s mixed-integer linear programming (MILP) framework is compatible with various mathematical programming optimization software, as highlighted in the 2023 INFOMRS optimization software survey, which lists up to 32 different solvers, many of which are available for free as part of university projects. By integrating a straightforward spreadsheet containing basic data on energy system costs with another updated spreadsheet for demand and weather forecasts, the PIM model can be seamlessly optimized using any suitable solver. This setup allows for automatic recalibration every 15 min or in response to forecast changes, ensuring the DER network operates at optimal efficiency concerning cost management (see Fig. 2 that explained the DER network control process). Implementing these optimal practices not only enhances operational efficiency but also aligns with the United Nations Sustainable Development Goals (SDGs). Specifically, it contributes to SDG 7 (Affordable and Clean Energy), SDG 11 (Sustainable Cities and Communities), and SDG 13 (Climate Action), by fostering more sustainable and efficient energy management practices. 6. Conclusions This paper has introduced a novel mixed-integer linear programming model building upon the foundations of production-inventory Fig. 11. Analysis of the DERCS performance after a weather perturbation in the rolling horizon. P. Cort´ es et al. Heliyon 10 (2024) e39900 16
models, drawing inspiration from aggregate production planning principles, to optimize a distributed energy resources’ network. The multi-period both electric and heating energy demands can be met either through a set of energy generation nodes (equivalent to the multi-factory concept in production planning) or from existing energy storage nodes (corresponding to the inventory concept in production planning). This innovative formulation, integrating production and inventory concepts for optimizing the operation of a Distributed Energy Resource network, is a pioneering contribution presented for the first time in the scientific literature within this paper. The elegance of this formulation lies in its capacity to efficiently address the complexities inherent in DER network optimization. Indeed, the model has demonstrated its effectiveness by providing optimal solutions across all evaluated instances. This constitutes a significant advantage over alternative approaches, including non-linear mathematical programming models that require the use of metaheuristics (which are unable to guarantee optimality and require longer computation times), and stochastic approaches that also need larger time slots to compute solutions, leading to a control of the DER network operation that is far from real-time. In fact, metaheuristics require substantial computational resources owing to their iterative processes, resulting in considerable time consumption for execution. This reality suggests that Distributed Energy Resource Control Systems relying on such approaches may face extended time requirements, potentially hindering their ability to achieve effective real-time control. On the other hand, it is remarkable that our approach solving time for each instance was achieved within 1 s. This quick computational performance significantly reduces the required time by the control loop within the rolling horizon of the control system. Consequently, this enables real-time control, constituting a noteworthy contribution to the real-time operation of distributed energy resource networks. The different rolling horizon scenarios presented in the case study vividly illustrate how the DERCS adeptly adjusts commands to accommodate changes and unforeseen events occurring in real-life scenarios. Indeed, the DERCS consistently demonstrated its ability to adapt and optimize energy commands promptly in response to changing forecasted input data. This dynamic responsiveness, coupled with the efficient performance of the optimizer, underscores the robustness and reliability of the proposed system in addressing real life experiences within a distributed energy resource network. To summarize, the major contributions of our research are as follows. First, the novel use of a MILP model for DER Networks integrating production and inventory concepts to optimize the operation of a Distributed Energy Resource (DER) network. This approach, to the best of our knowledge, is unprecedented in the scientific literature. The model’s elegance lies in its ability to efficiently address the complexities of DER network optimization, consistently providing optimal solutions within a very short time frame. Second, its rapid problem-solving capability brought by the proposed model that solves in less than 1 s, enabling nearinstantaneous decision-making. This swift solution time surpasses any known references in the field, effectively shifting the bottleneck in DER network operation from the decision-making process to the forecasting of demand and weather conditions. While Fig. 12. Analysis of the DERCS performance after an increase in the electric and heating demands in the rolling horizon. P. Cort´ es et al. Heliyon 10 (2024) e39900 17
forecasting typically requires a minimum of 15 min, our approach suggests that a reduction in this forecasting time could further enhance the control system’s response time, given the model’s ability to deliver optimal solutions almost immediately. Third, the authentic capability for real-time optimization and stochastic Integration. In fact, the real-time availability of optimal solutions (within less than 1 s) allows for the seamless incorporation of stochastic elements into the control loop via a rolling horizon process. This continuous updating of forecasts related to demand and weather conditions affecting RES ensures more precise and timely decision-making. The use of a MILP model guarantees optimal results every second, outperforming stochastic models that typically rely on approximate solutions. Despite the advancements presented in our study, several open issues remain where additional research and novel contributions are necessary. The most significant challenge lies in addressing the non-linearities affecting battery performance and the calculation of equivalent electric performance in Combined Heat and Power systems. The first-order simplifications discussed in Section 4enable the quick solution of our MILP (PIM problem). Without these simplifications, Gurobi would struggle to find the optimum for many real instances of a mixed-integer non-linear programming model. Additionally, current metaheuristics often fail to provide optimal solutions for non-linear models and require substantial computation time, making real-time control of DER network operations challenging when considering non-linearities. To address these challenges, several new research avenues could be explored. One potential approach is the use of special ordered sets of type 2 to linearly approximate the non-linear model, though this may result in a loss of optimality guarantee. Comparing this approach with our current model would be necessary to assess its effectiveness. Another promising direction is the development of faster and more accurate metaheuristics that can find solutions closer to the optimum for non-linear problems. Further exploration of these methods could significantly enhance the real-time control capabilities of DER networks. CRediT authorship contribution statement Pablo Cort´ es: Writing – review & editing, Writing – original draft, Validation, Supervision, Methodology, Investigation, Formal analysis. Alejandro Escudero-Santana: Validation, Software, Investigation, Data curation. Elena Barbadilla-Martin: Resources, Investigation. Jos´ e Guadix: Project administration, Investigation, Funding acquisition. Data availability Data are available at Escudero Santana, A., & Cort´ es, P. (2024). Distributed energy generation and storage [Dataset]. Dataset DOI: https://doi.org/10.12795/11441/156375. Funding The authors of the article with the title “A production-inventory model to optimize the operation of distributed energy resource networks in a rolling horizon” declare that the paper has been supported by the RTD project entitled CONFORES project (Ref. TED2021-130659B-I00) funded by Proyectos de Transici´ on Ecol´ ogica y Transici´ on Digital. Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. References [1] S. Huang, Z. Ye, Y. Huang, Does it reasonable to include grid-side energy storage costs in transmission and distribution tariffs? Benefit evaluation based on economic externality, Heliyon 9 (11) (2023) e21476. [2] J. Vehmas, J. Kaivo-Oja, J. Luukkanen, Energy efficiency as a driver of total primary energy supply in the EU-28 countries–incremental decomposition analysis, Heliyon 4 (10) (2018) e00878. [3] A. Ala, V. Simic, D. Pamucar, C. Jana, A novel neutrosophic-based multi-objective grey wolf optimizer for ensuring the security and resilience of sustainable energy: a case study of Belgium, Sustain. Cities Soc. 96 (2023) 104709. [4] A. Mohammadnia, F. Iov, M.K. Rasmussen, M.P. Nielsen, Feasibility assessment of next-generation smart district heating networks by intelligent energy management strategies, Energy 296 (2024) 131104. [5] C. Sun, L. Yuan, Y. Chen, S. Cao, G. Xia, C. Qi, X. Wu, An intelligent control and regulation strategy aiming at building level heating balance in district heating system, Energy 278 (2023) 127941. [6] J. Guo, K. Zhu, Y. Cheng, Deployment of clean energy technologies towards carbon neutrality under resource constraints, Energy 295 (2024) 131012. [7] X. Zhang, W. Xu, A. Rauf, I. Ozturk, Transitioning from conventional energy to clean renewable energy in G7 countries: a signed network approach, Energy 307 (2024) 132655. [8] D. Rebollal, M. Carpintero-Rentería, D. Santos-Martín, M. Chinchilla, Microgrid and distributed energy resources standards and guidelines review: grid connection and operation technical requirements, Energies 14 (3) (2021) 523. [9] D. Wu, X. Ma, S. Huang, T. Fu, P. Balducci, Stochastic optimal sizing of distributed energy resources for a cost-effective and resilient Microgrid, Energy 198 (2020) 117284. [10] J. Sousa, J. Lagarto, C. Camus, C. Viveiros, F. Barata, P. Silva, R. Alegría, O. Paraíba, Renewable energy communities optimal design supported by an optimization model for investment in PV/wind capacity and renewable electricity sharing, Energy 283 (2023) 128464. [11] A. Ala, A. Mahmoudi, S. Mirjalili, V. Simic, D. Pamucar, Evaluating the performance of various algorithms for wind energy optimization: a hybrid decisionmaking model, Expert Syst. Appl. 221 (2023) 119731. P. Cort´ es et al. Heliyon 10 (2024) e39900 18
[12] K.H. Khan, M.G. Rasul, M.M.K. Khan, Energy conservation in buildings: cogeneration and cogeneration coupled with thermal energy storage, Appl. Energy 77 (1) (2004) 15–34. [13] G. Zhao, J. Clarke, J. Searle, R. Lewis, J. Baker, Economic analysis of integrating photovoltaics and battery energy storage system in an office building, Energy Build. 284 (2023) 112885. [14] G. Xu, L. Hu, Y. Luo, Z. Tian, J. Deng, G. Yuan, J. Fan, Numerical modeling and parametric analysis of thermal performance for the large-scale seasonal thermal energy storage, Energy Build. 275 (2022) 112459. [15] A. Cosic, M. Stadler, M. Mansoor, M. Zellinger, Mixed-integer linear programming based optimization strategies for renewable energy communities, Energy 237 (2021) 121559. [16] M. Wirtz, M. Hahn, T. Schreiber, D. Müller, Design optimization of multi-energy systems using mixed-integer linear programming: which model complexity and level of detail is sufficient? Energy Convers. Manag. 240 (2021) 114249. [17] R. Lahdelma, H. Hakonen, An efficient linear programming algorithm for combined heat and power production, Eur. J. Oper. Res. 148 (2003) 141–151. [18] A. Rong, R. Lahdelma, An efficient linear programming model and optimization algorithm for trigeneration, Appl. Energy 82 (2005) 40–63. [19] E. Thorin, H. Brand, C. Weber, Long-term optimization of cogeneration systems in a competitive market environment, Appl. Energy 81 (2005) 152–169. [20] H. Cho, R. Luck, S.D. Eksioglu, L.M. Chamra, Cost-optimized real-time operation of CHP systems, Energy Build. 41 (2009) 445–451. [21] H. Cho, P.J. Mago, R. Luck, L.M. Chamra, Evaluation of CCHP systems performance based on operational cost, primary energy consumption, and carbon dioxide emission by utilizing an optimal operation scheme, Appl. Energy 86 (2009) 2540–2549. [22] H. Ren, W. Zhou, K. Nakagami, W. Gao, Q. Wu, Multi-objective optimization for the operation of distributed energy systems considering economic and environmental aspects, Appl. Energy 87 (12) (2010) 3642–3651. [23] Y. Li, B. Feng, B. Wang, S. Sun, Joint planning of distributed generations and energy storage in active distribution networks: a Bi-Level programming approach, Energy 245 (2022) 123226. [24] P. Cort´ es, J. Mu˜ nuzuri, M. Berrocal-de-O, I. Domínguez, Genetic algorithms to optimize the operating costs of electricity and heating networks in buildings considering distributed energy generation and storage, Comput. Oper. Res. 96 (2018) 157–172. [25] P. Cort´ es, J. Mu˜ nuzuri, L. Onieva, J. Guadix, A discrete particle swarm optimisation algorithm to operate distributed energy generation networks efficiently, Int. J. Bio-Inspired Comput. 12 (4) (2018) 226–235. [26] Z. Yang, H. Tian, H. Min, F. Yang, W. Hu, L. Su, S. SaeidNahaei, Optimal microgrid programming based on an energy storage system, price-based demand response, and distributed renewable energy resources, Util. Pol. 80 (2023) 101482. [27] A.S. Farsangi, S. Hadayeghparast, M. Mehdinejad, H. Shayanfar, A novel stochastic energy management of a microgrid with various types of distributed energy resources in presence of demand response programs, Energy 160 (2018) 257–274. [28] J. Lohmer, R. Lasch, Production planning and scheduling in multi-factory production networks: a systematic literature review, Int. J. Prod. Res. 59 (7) (2021) 2028–2054. [29] A. Aazami, M. Saidi-Mehrabad, A production and distribution planning of perishable products with a fixed lifetime under vertical competition in the seller-buyer systems: a real-world application, J. Manuf. Syst. 58 (2021) 223–247. [30] S. Ruidas, M.R. Seikh, P.K. Nayak, A production inventory model with interval-valued carbon emission parameters under price-sensitive demand, Comput. Ind. Eng. 154 (2021) 107154. [31] N. Azad, A. Aazami, A. Papi, A. Jabbarzadeh, A two-phase genetic algorithm for incorporating environmental considerations with production, inventory and routing decisions in supply chain networks, in: Proceedings of the Genetic and Evolutionary Computation Conference Companion, 2019, pp. 41–42. [32] P. Cort´ es, P. Auladell-Le´ on, J. Mu˜ nuzuri, L. Onieva, Near-optimal operation of the distributed energy resources in a smart microgrid district, J. Clean. Prod. 252 (2020) 119772. [33] H.K. Ringkjøb, P.M. Haugan, I.M. Solbrekke, A review of modelling tools for energy and electricity systems with large shares of variable renewables, Renew. Sustain. Energy Rev. 96 (2018) 440–459. [34] A. Escudero Santana, P. Cort´ es, Distributed Energy Generation and Storage. , 2024. [35] M.D. Wilkinson, et al., The FAIR Guiding Principles for scientific data management and stewardship, Sci. Data 3 (1) (2016) 1–9. P. Cort´ es et al. Heliyon 10 (2024) e39900 19