원시데이터 수집 시스템
선정목록으로

Simultaneous costs minimizing in electricity and gas micro-grids with the presence of distributed generation

간접 관련 수소연료전지 · (7) MEA(막전극접합체) (5) 연료전지용 수분제어장치(가습기)(6) PEM(고분자전해질막)

기본 정보

저자
  1. Shahryar Behnia — Department of Electrical Engineering, Kermanshah Branch, Islamic Azad University, Kermanshah, Iran.
  2. Saeed Kharrati — Department of Electrical Engineering, Kermanshah Branch, Islamic Azad University, Kermanshah, Iran.
  3. Farshad Khosravi — Department of Electrical Engineering, Kermanshah Branch, Islamic Azad University, Kermanshah, Iran.
  4. Abdollah Rastgou — Department of Electrical Engineering, Kermanshah Branch, Islamic Azad University, Kermanshah, Iran.
DOI
10.1371/journal.pone.0309999
저널
PLoS ONE
발행년도
2024
발행기관
Public Library of Science
피인용수
2
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1371/journal.pone.0309999
토픽
Hybrid Renewable Energy Systems
OpenAlex ID
W4402626658

평가 내용

관련도
간접 관련
사업분야
수소연료전지 · (7) MEA(막전극접합체)
부 분야
(5) 연료전지용 수분제어장치(가습기), (6) PEM(고분자전해질막)
R&D 측면
분석·모델링
확신도
0.70
근거 용어
fuel cells, micro-grids, distributed generation, optimization, energy storage system
판단 근거
논문은 전기 및 가스 마이크로그리드 내에서 연료전지(Fuel Cells)와 분산 전원을 포함한 에너지 시스템의 비용 최적화 모델링을 다루고 있습니다.
R&D 활용 포인트
코오롱인더스트리의 수소연료전지(PEMFC) 사업과 관련하여, 연료전지가 포함된 에너지 허브 및 마이크로그리드 시스템 내에서의 운영 효율성 및 경제성 분석 모델로 활용 가능합니다.
평가 입력
본문 76,161자 중 30,032자 발췌

초록

Distributed generation can actively participate in the day-ahead markets, real-time power balance, and wholesale gas markets to achieve various goals, such as supplying gas to various electric power generation plants. A multi-objective network with two types of loads is considered in this paper. The reason for the simultaneous optimization of these two networks is that these two energy carriers are dependent on each other and gas is needed to produce electricity, so this issue can be addressed with a multi-objective function. The simulation carried out in this article is coded in GAMS software as a mixed integer linear programming (MILP). The efficiency of gas turbines and fuel cells in this article is dependent on their working point, and considering the exact model of these resources and the relationships related to the calculation of their fuel consumption is non-linear. On the other hand, a binary variable has been used to show the charging and discharging state of the storage and the on-and-off state of the gas turbines. Therefore, the problem considered in this article is a MILP problem. The results of this article are the proper planning of charging and discharging of the energy storage system with the proper planning of the power generation of different energy sources considering the network loads in two optimized and non-optimized scenarios.

본문 76,161자

본문 펼치기
# PLOS ONE ~~<u>[a1111111111](http://crossmark.crossref.org/dialog/?doi=10.1371/journal.pone.0309999&domain=pdf&date_stamp=2024-09-19)</u>~~ ~~<u>[a1111111111](http://crossmark.crossref.org/dialog/?doi=10.1371/journal.pone.0309999&domain=pdf&date_stamp=2024-09-19)</u>~~ ~~<u>[a1111111111](http://crossmark.crossref.org/dialog/?doi=10.1371/journal.pone.0309999&domain=pdf&date_stamp=2024-09-19)</u>~~ ~~<u>[a1111111111](http://crossmark.crossref.org/dialog/?doi=10.1371/journal.pone.0309999&domain=pdf&date_stamp=2024-09-19)</u>~~ ~~<u>[a1111111111](http://crossmark.crossref.org/dialog/?doi=10.1371/journal.pone.0309999&domain=pdf&date_stamp=2024-09-19)</u>~~ OPEN ACCESS Citation: Behnia S, Kharrati S, Khosravi F, Rastgou A (2024) Simultaneous costs minimizing in electricity and gas micro-grids with the presence of distributed generation. PLoS ONE 19(9): [e0309999. https://doi.org/10.1371/journal.](https://doi.org/10.1371/journal.pone.0309999) [pone.0309999](https://doi.org/10.1371/journal.pone.0309999) Editor: Mohit Bajaj, Graphic Era Deemed to be University, INDIA Received: March 12, 2024 Accepted: August 23, 2024 Published: September 19, 2024 Peer Review History: PLOS recognizes the benefits of transparency in the peer review process; therefore, we enable the publication of all of the content of peer review and author responses alongside final, published articles. The editorial history of this article is available here: [https://doi.org/10.1371/journal.pone.0309999](https://doi.org/10.1371/journal.pone.0309999) Copyright: © 2024 Behnia et al. This is an open access article distributed under the terms of the [Creative Commons Attribution License, which](http://creativecommons.org/licenses/by/4.0/) permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Data Availability Statement: "All relevant data are within the paper and its Supporting Information files. RESEARCH ARTICLE ## Simultaneous costs minimizing in electricity and gas micro-grids with the presence of distributed generation [Shahryar Behnia, Saeed KharratiID*, Farshad Khosravi, Abdollah Rastgou](https://orcid.org/0000-0001-8631-0680) Department of Electrical Engineering, Kermanshah Branch, Islamic Azad University, Kermanshah, Iran - dr.kharati@gmail.com ### Abstract Distributed generation can actively participate in the day-ahead markets, real-time power balance, and wholesale gas markets to achieve various goals, such as supplying gas to vari ous electric power generation plants. A multi-objective network with two types of loads is considered in this paper. The reason for the simultaneous optimization of these two net works is that these two energy carriers are dependent on each other and gas is needed to produce electricity, so this issue can be addressed with a multi-objective function. The simu lation carried out in this article is coded in GAMS software as a mixed integer linear program ming (MILP). The efficiency of gas turbines and fuel cells in this article is dependent on their working point, and considering the exact model of these resources and the relationships related to the calculation of their fuel consumption is non-linear. On the other hand, a binary variable has been used to show the charging and discharging state of the storage and the on-and-off state of the gas turbines. Therefore, the problem considered in this article is a MILP problem. The results of this article are the proper planning of charging and discharging of the energy storage system with the proper planning of the power generation of different energy sources considering the network loads in two optimized and non-optimized scenarios. 1. Introduction Undoubtedly, one of the main challenges in the last century is the energy challenge. This challenge in various fields of energy, including energy supply, exchange and consumption, due to population growth, increasing global demand for energy, lack of fossil fuels and environmental pollution, and concern about energy security for all countries of the world, has become an important topic. The close relationship of energy with economy, social, environmental and security aspects has doubled its importance. Energy-related issues are important issues in this field, for example, we can refer to issues such as energy security, fair distribution, affordability, reliability, efficiency, and suitability for the environment [1]. Producing electricity near the place of consumption, in addition to reducing losses in the system, can have more flexibility to provide various services to consumers. With the increasing [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 1 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas Funding: The author(s) received no specific funding for this work. Competing interests: The authors have declared that no competing interests exist. penetration of distributed generation (DG) in power grids and considering different technologies, the uncertainties of its renewable types, Major challenges are raised for the design of power systems in the future. One of the methods of aggregating distributed generation resources is a concept called micro-grid (MG). MGs are low-voltage and medium-voltage active distribution networks that consist of a set of loads, distributed generation sources and control devices. Due to the independence in operation, these networks can be separated from the main network and operated as islands. The main purpose of forming these networks is technical issues related to increasing the reliability and quality of electricity delivered to consumers. Therefore, from the point of view of the upstream networks, the MG is an element with dual characteristics, which is sometimes considered a burden and sometimes a source of production. With the significant growth of smart grids as well as the rapid improvement of communication platforms between production and consumption, MGs have moved towards smart-grid and the practical concept of electric smart MGs has been created. Using this model in case of adopting a comprehensive telecommunication infrastructure for energy management and protection is considered a suitable approach that can be applied to the current distribution networks in which the penetration of distributed generation will increase over time. Similar to the path of evolution of ordinary electric MGs to smart electric MG s and then the comprehensive management of smart electric MGs, Hub Energy has also evolved in the form of Hub Energy MGs, Smart Energy Hub MGs and a comprehensive network of Smart Energy Hub MGs [2]. In the past, different energy systems were planned and managed independently. But today, the development of technologies such as the efficient multi-generation system leads to the realization of the benefits of integrated energy infrastructures such as electricity, natural gas and district heating (DH) networks, and as a result, the rapid movement towards multi-energy systems (MES). In such systems, energy carriers and different systems interact synergistically. However, paying attention to such a concept requires a suitable tool for the integrated management of system components. An energy Hub (EH), which can be defined as a place where the production, conversion, storage and consumption of different energy carriers takes place, is a promising option for the integrated management of multi-energy systems. According to reference [2], a centralized system of smart energy hub MGs is connected to a large central supplier. In this reference, the real-time pricing of the connected network is examined. Also, two types of smart hub MGs have been considered for connected centralized energy systems. Not using normal MGs, not checking distances and the possibility of connecting the introduced hub MGs in terms of distance, etc. can be considered as weak points of this research. In reference [3–5], a transmission network of energy carriers in the form of gas and electricity is introduced, which is intelligently provided through one or two central suppliers and with a telecommunication connection, MG. The smart hub is fed in different areas. The one-way energy path from the supplier to the consumer, the lack of attention to distributed generation sources and smart energy hubs, and as a result the lack of two-way energy exchange between smart energy hubs, are among the weak points of this research. According to reference [6], an advanced hybrid power generation cycle was evaluated to obtain sustainable energy with high power and efficiency. This combined cycle includes biomass gasification, Cascaded Humidified Advanced Turbine (CHAT) and steam turbine. The fuel consumed by the system is obtained from the gas produced in the process of conversion to biomass gas. Reference [7] focuses on minimizing operational cost and optimal power distribution associated with MGs coupled with natural gas networks using Particle Swarm Optimization (PSO). Introducing a natural gas turbine in an MG to overcome the disadvantages of renewable [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 2 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas energy sources is a recent trend. This increases the load and congestion in the gas network. To avoid congestion and balance the load, it is necessary to coordinate with the power grid to plan for the optimal transmission of both interactive networks. Reference [8] presents a comparative case study with multiple biomass sources to analyze biological feedstock logistics plans with distributed warehouses and a primary warehouse located with the biological. An MILP model for simultaneous optimization of feedstock decisions and optimal preprocessing warehouse locations and sizes, using biomass sources from agricultural residues, energy, and municipal solid waste to meet carbohydrate specifications and feedstock demand for a biochemical conversion process is developed. Reference [9] proposes a multi-product multi-source framework for multi-carrier energy sources coupled with a biogas-solar-wind hybrid renewable system. In this framework, biogassolar-wind complements are fully exploited based on the thermodynamic effects of digestion for the synergistic interactions of electricity, gas and heating energy flows, and a coupling matrix is formulated to model production, conversion, storage and consumption. According to reference [10], a practical method for analyzing the economic distribution of a power system is described using the Lagrange coefficient method according to the Cohen-Tucker conditions, without considering the limitations and transmission losses. Reference [11] provides a new perspective and a complete mathematical tool to study the integrated energy system from the illegal market perspective. A Mathematical Program with an Equilibrium Constraint (MPEC) model is proposed to study the strategic behaviors of a profit-oriented energy pole in the electricity market and the heating market under the background of energy system integration. At the top level, the Energy Hub provides prices and quantities to an electricity distribution market and a heating market. At the lower level, two markets are settled and energy contracts are determined between the energy hub and two energy markets. The network limitations of physical systems are explicitly shown by an optimal power flow problem and an optimal heat flow problem. Reference [12] presents the coordinated energy management of energy hubs in different networks based on the cooperation of hubs in Day-ahead markets. The proposed model connects electricity, natural gas and district heating networks by considering electricity, and natural gas as hub input and electric energy and district heating as hub output. Reference [13] focuses on the optimal scheduling of regional energy systems with multiple energy supply modes and flexible loads. For the multi-energy system, the energy hub model including an energy storage system and integrated electric vehicle is developed. Multi-Carrier Hub Energy System (MCHES) meets different energy needs such as heating, cooling and energy demand by using different energy sources simultaneously. According to reference [14], a robust optimization approach (ROA) for robust multi-carrier energy hub system planning considering economic and environmental constraints in the presence of market price uncertainty and multi-demand response programs (DRP) is provided. In reference [15], there is a review of gas and electricity routes at the same time. This reference is a review of research considering the balance of these two energy carriers to become an energy hub and the works of this energy field have been reviewed. Reference [16] has also measured the effect of electrical routes on decision-making about gas routes and vice versa and has optimized these routes accordingly. In reference [17], the simultaneous effect of these two networks in macro-decision-making to become an energy hub has been considered. The expansion of renewable production sources that are distributed in the network creates many challenges for the electricity distribution networks. Recent advances in battery technologies have made battery energy storage systems (BESS) more economical than in the past, which is why these equipment are used. It is suitable for use in the network and at the distribution level. Also, the distributed BESS can act as a factor for more penetration of renewable [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 3 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas energies in the distribution network [18]. This reference obtains the most optimal mode for the placement and size of batteries. This situation is obtained according to the cost of batteries, operation, maintenance, etc. According to reference [19], each MG operator communicates with the distribution network operator (DNO) in the control layer to manage consumption and production. DNO plans production resources by considering the possible islanding of MGs in the distribution network. In reference [20], a sensitivity analysis is performed to investigate the impact of these technologies on unbalanced low-voltage residential networks located in Northern Ireland. The influence of different powers has been investigated and the results have been evaluated using different technical indicators. In reference [21], an optimal technique for the optimal location of the battery energy storage system (BESS) and the wind power penetration capacity for battery charging/discharging is proposed. Reference [22] deals with the optimal allocation of BESS in radial distribution systems to regulate bus voltage and reduce energy costs. According to reference [23], in recent years, the BESS has been considered a promising solution to reduce wind turbine generator frequencies. In references [24,25], the improvement of wind turbine performance to reduce the fluctuation of output power and also to increase the extracted energy in an MG has been investigated. Also, in references [26–28], the lifetime estimation of electrical network equipment has been reviewed. In distribution networks, the voltage stability index is an important issue and is considered a security objective function. Therefore, it is necessary to check this index by energy management in the distribution network. According to [29], this index is taken into account and dynamic distribution feeder reconfiguration (DDFR) is introduced as a suitable method for this management. This study has been considered by considering the voltage stability index, power loss and operation cost in a distribution network with the presence of PV, energy storage system and capacitors. In distribution networks, electricity prices and load patterns are constantly changing, and accordingly, many operational problems will affect electricity distribution networks. Therefore, to prevent these incidents, the problem will be considered in different time frames. In [30], a multi-objective optimization model is presented using the DDFR procedure in the distribution system and in multiple time intervals with the presence of energy storage systems and PV units. In [31], a cost-effective energy hub system is proposed using linear programming, considering transformer converters, combined heat and power (CHP), heat exchangers, and energy storage, including electric vehicle charging stations (EVCSs), and heat storage. Market exchanges for placement and appropriate size of DGs in an electricity distribution network have been investigated by proposing an appropriate algorithm in [32]. Also, the energy management of the MG connected to the grid is described in [33]. The short-term planning of the network to use renewable energy sources and increase their penetration has also been evaluated in [34]. Electric energy management in the smart rural network has also been investigated according to [35]. By reviewing the references and stating the goals of each one, the summary of the work done and its comparison with the innovations of this paper is shown in Table 1. According to this table, it is clear that the simultaneous examination of gas and electricity in the network, considering different types of load to analyze the results, and considering the energy hub management are among the innovations of this article that are less discussed in previous works. Also, the type of objective function in this work is one of its other specific innovations. In the basic state, MGs work as islands or not islands (connect to the grid). But the main point is the optimal communication of these MGs and their intelligent management and exploitation; in a way that can achieve the most optimal mode of using energy from a technical [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 4 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas Table 1. _Compare the proposed method and previous methods_ . <u>No.</u> <u>Aspect</u> <u>[19]</u> <u>[20]</u> <u>[21]</u> <u>[22]</u> <u>[23]</u> <u>[24]</u> <u>[25]</u> <u>[29]</u> <u>[30]</u> <u>[31]</u> <u>This paper</u> <u>1</u> <u>Energy Losses</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>2</u> <u>Prediction Model</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>3</u> <u>EV Considering</u> <u>✓</u> <u>4</u> <u>Unbalance Load</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>5</u> <u>Demand Response Considering</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>6</u> <u>Feeder Reconfiguration</u> <u>✓</u> <u>✓</u> <u>7</u> <u>Voltage Stability Considering</u> <u>✓</u> <u>✓</u> <u>8</u> <u>ES & different DGs Considering</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>9</u> <u>Multi-Objective Analysis</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>10</u> <u>24-Hours Analysis</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>✓</u> <u>11</u> <u>EH Managing</u> <u>✓</u> <u>✓</u> <u>12</u> <u>Load Types Considering</u> <u>✓</u> <u>13</u> <u>Simultaneous gas & Electricity Considering</u> <u>✓</u> <u>✓</u> - EV: Electrical Vehicle–ES: Energy Storage–DG: Distributed Generation–EH: Energy Hub. [https://doi.org/10.1371/journal.pone.0309999.t001](https://doi.org/10.1371/journal.pone.0309999.t001) and economic point of view. Therefore, in this article, we will try to optimize the objective function with two issues electricity and gas. The purpose of optimization is to reduce network costs. In the non-optimized state, the costs of both energy sources will be much higher and we will not reach the optimal point in fuel consumption. In other words, we may go to gas power plants during the hours when we need electric energy and we can use relatively cheaper energy such as solar energy during the day, thus increasing the network costs. However, with optimal energy consumption and production side management, network costs can be optimized and this cost can be transferred to investment in other sectors. This review will consider the 24-hour optimal points for the MG from the perspective of cost. Based on this, the innovations of this paper include the simultaneous use of gas and electricity energy network along with distributed generation sources on the standard network, simulation with real and variable values of loads and energy prices on the model MG, optimal dispatch of energy in the standard MG, for 24-hour, in terms of cost minimization and a practical look at the problem of energy management in MGs. Based on this, in the second part of this article, the concept of an energy hub will be discussed. Then, in the third part, the modelling and expression of the relationships related to this research will be discussed, and based on that, the implementation procedure and related algorithms will be evaluated in detail. Next, in the fourth part of the article, the results obtained from this research will be explained. Based on the results of this discussion, the simultaneous minimization of the costs of electricity and gas MGs along with distributed generation sources and the production of each unit will be explained in detail. In the rest of the article, the obtained results will be discussed. At the end, the general conclusion will be expressed. 2. Energy hub concept The Energy Hub (EH) concept was developed by a research team at the High Voltage Power Systems Laboratory in Zurich in the framework of a project called Vision of Future Energy Networks (VOFEN). This project aims to create a picture of future energy systems in the long term (20 to 30 years) using the Greenfield approach [1]. The main points of the VOFEN project can be summarized as follows: [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 5 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas - Moving towards multi-energy systems to benefit from the synergistic benefits of different energy carriers. - Moving towards non-hierarchical structures. - Moving towards integrated and connected energy systems - In this paper, two concepts are presented to reach the main points mentioned. - Energy connectors: combined transport of different energy carriers over longer distances in single transmission devices. - Energy hub: conversion and storage of energy carriers in an integrated unit Therefore, the concept of EH was introduced as a result of the VOFEN project and as an interface between consumers, producers, storage devices and transmission devices in different ways directly or through conversion equipment or multiple carriers. Fig 1 shows the matrix model of the concept of EH to communicate different energy carriers in the input and output through the pairing matrix. Each element of the matrix represents the internal characteristics of EH, including the coefficients of connection and conversion of internal components of EH. In further studies, the energy hub is defined as follows [1]: - An EH is considered a unit in which several energy carriers can be converted, conditioned and stored. - A more precise definition of EH can be stated as follows: - EH is a unit that provides functions of input, output, conversion and storage of multiple energy carriers. Sometimes, next to the energy hub, the word hybrid is used, which refers to the interaction of different energy carriers in EH [1]. <u>Fig 1.</u> <u>Power conversion modeling through an energy hub.</u> [https://doi.org/10.1371/journal.pone.0309999.g001](https://doi.org/10.1371/journal.pone.0309999.g001) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 6 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas 3. Implementation method In this section, the modeling of the article’s proposed procedure and the implementation method will be explained in detail. 3.1. Micro-grid modeling In this part, the investigated MG models will be examined in detail along with the basic relationships of each part. 3.1.1. Price modeling. MGs participating in the market provide an hourly bid (PiM,tBid) for the next day of energy trading. The MG is in consumer-state when the offered offer is negative, otherwise it will be producer. Changes between production and demand will lead to a power imbalance between the actual power and the proposed power (ΔPtImba) as shown in the 3.1.1. Price modeling. MGs participating in the market provide an hourly bid (PiM,t power imbalance between the actual power and the proposed power (ΔPtImba) as shown in the following equation: D _Pt_ <sup>Im</sup> <sup>_ba_</sup> _t_ <sup>Im</sup> <sup>_ba_</sup> ¼ _Pt_ <sup>_Act_</sup> X _M_ _t_ <sup>_Act_</sup> _PiM_ <sup>_Bid_</sup> _;t_ 8 _t_ ð1Þ _PiM_ <sup>_Bid_</sup> _;t_ _iM_ ¼1 So that PtAct is the real power and it is obtained as the following equation: _Pt_ <sup>_Act_</sup> ¼ X _M_ _iM_ ¼1 ð _PiM_ <sup>_Wind_</sup> _;t_ _iM_ <sup>_Wind_</sup> _;t_ <sup>þ</sup> <sup>_P_</sup> _iM_ <sup>_PV_</sup> _iM_ <sup>_PV_</sup> _;t_ <sup>þ</sup> <sup>_P_</sup> _iM_ <sup>_DG_</sup> _;_ _iM_ <sup>_DG_</sup> _;t_ <sup>þ</sup> <sup>_P_</sup> _iM_ <sup>_BESS_</sup> _;t_ _iM_ <sup>_BESS_</sup> _;t_ <sup>Þ þ</sup> X _L_ _j_ ¼1 _Pjt_ <sup>_De_</sup> ð2Þ X _L_ _j_ ¼1 _Pjt_ <sup>_IL_</sup> <sup>�</sup> where PiM,tWind, PiM,tPV, PiM,tDG and PiM,tBESS are respectively the outputs of a wind turbine, solar panel, DG unit and battery energy storage systems (BESS) at time t and MG iM, PjtDe Wind, PiM,t DG and PiM,t where PiM,t PV, PiM,t solar panel, DG unit and battery energy storage systems (BESS) at time t and MG iM, PjtDe and PjtIL show the power demand and Interrupted Load (IL) at time t and bus j, respectively. In PjtIL show the power demand and Interrupted Load (IL) at time t and bus j, respectively. In addition, M and L are the total number of MGs and loads in the system. According to the amount of power deviation, the CosttImba imbalance cost can be obtained as follows: tImba imbalance cost can be obtained as follows: ( r <sup>Re</sup> _t_ <sup>þ</sup> <sup>Re</sup> _t_ <sup>þ</sup> _:_ D _Pt_ <sup>Im</sup> <sup>_ba_</sup> <sup>Re</sup> _t_ <sup>�</sup> _:_ D _Pt_ <sup>Im</sup> <sup>_ba_</sup> _t_ <sup>Im</sup> <sup>_ba_</sup> _;_ D _Pt_ <sup>Im</sup> <sup>_ba_</sup> _t_ <sup>Im</sup> <sup>_ba_</sup> _;_ D _Pt_ <sup>Im</sup> <sup>_ba_</sup> _t_ <sup>Im</sup> <sup>_ba_</sup> _<_ 0 _t_ <sup>Im</sup> <sup>_ba_</sup> - 0 ð3Þ _Costt_ <sup>Im</sup> <sup>_ba_</sup> ¼ r <sup>Re</sup> _t_ <sup>�</sup> where ρtRe- and ρtRe+ provide the regulatory prices for the sale and purchase of electric energy in the RTB (Real-time balancing) market at time t, respectively. In addition, the DA market price is applied as a multiplier to calculate regulatory prices: Re- and ρt where ρt ( r <sup>Re</sup> _t_ <sup>þ</sup> <sup>Re</sup> _t_ <sup>þ</sup> ¼ ð1 þ t <sup>þ</sup> Þ _:_ r <sup>_DA_</sup> _t_ <sup>Re</sup> _t_ <sup>�</sup> ¼ ð1 þ t <sup>�</sup> Þ _:_ r <sup>_DA_</sup> _t_ ð4Þ _t_ _t_ r <sup>Re</sup> _t_ <sup>�</sup> ¼ ð1 þ t <sup>�</sup> Þ _:_ r _t_ _t_ where τ <sup>-</sup> and τ <sup>+</sup> are the relative differences between the sale and purchase price of electricity and the DA market price. The connection of electricity and gas networks along with electric and gas devices is shown in Fig 2. According to this figure, it can be seen that two renewable sources, wind and solar, are located in the grid together with the distributed gas generation source as sources of electric power generation. The gas distribution source is also connected to the gas network, and based on that, it is connected to the country’s gas network, and it is necessary to have gas lines next to the electric lines. Therefore, according to this figure, it can be concluded that considering these two networks at the same time is very important. 3.1.2. Gas system modeling. In this part, gas system models and related relationships will be discussed. _3.1.2.1. Line-pack modeling_ . In the pipelines of gas networks, compressed gas energy is called Line-pack (LP) and has a direct relationship with the average pressure in the pipelines. [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 7 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 2.</u> <u>Schematic of MGs in coupled gas and electricity networks.</u> [https://doi.org/10.1371/journal.pone.0309999.g002](https://doi.org/10.1371/journal.pone.0309999.g002) According to Boyle’s law, gas in pipelines can be modeled as Eqs (A-1) and (A-2) in S1 Appendix, where Pr, z, vij and Te are gas pressure (kPa), density (Kg/m <sup>3</sup> ), volume (m <sup>3</sup> ) and temperature (K), respectively. Also, the values of Pr0, z0, vij0 and Te0 are pressure, density, volume and temperature in normal gas conditions, respectively. Q <sup>Gas</sup> and Y <sup>Gas</sup> values are gas compressibility coefficient and gas constant, respectively. leij and dij are the length and inner diameter of pipe i-j. In dynamic conditions, the value of LP depends on the initial value of LP and the difference between gas consumed and supplied in the pipeline (ΔPij,tGas). Gas consumers include non between gas consumed and supplied in the pipeline (ΔPij,tGas). Gas consumers include non electric gas loads, compressor loads, gas storage, DG gas loads. The gas network and storage are also considered as gas suppliers. In steady state, the size of LP is calculated as Eqs (A-3) and (A-4) in S1 Appendix, where θijInitial and θij,t are the initial LP and the value of LP at time t, (A-4) in S1 Appendix, where θijInitial and θij,t are the initial LP and the value of LP at time t, respectively. γ is the gas volume to energy converter coefficient in normal conditions (GJ/m <sup>3</sup> ). Δt is the time it takes to convert power into energy. PGas,ijtDe, PGas,ijtGen and PGas,ijtComp are Δt is the time it takes to convert power into energy. PGas,ijtDe, PGas,ijtGen and PGas,ijtComp are demand, supplied gas and gas consumed by the compressor, respectively. Gen and PGas,ijt De, PGas,ijt _3.1.2.2. Gas and compressor flow modeling_ . Compressor and pipelines are two key elements of transmission system in gas networks. At steady state, the gas flow (fijGas) and direction [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 8 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas (Sgnij) are usually modeled by the Weymouth equation and depend on the gas pressure between the nodes. The flow equation of the pipeline between nodes i and j is presented as Eqs (A-5) and (A-6) in S1 Appendix, where Pi (Pj) is the gas pressure at node i (j). Gr, χij and z are the gravity ratio, friction coefficient and air constant, respectively. For a compressor, the gas flow (fGas,ijComp) and the amount of energy consumption are con trolled by Eqs (A-7) and (A-8) in S1 Appendix, where PGas,ijtComp and HPGas,ijtComp are gas For a compressor, the gas flow (fGas,ij Comp and HPGas,ijt trolled by Eqs (A-7) and (A-8) in S1 Appendix, where PGas,ijtComp and HPGas,ijtComp are gas consumption and horsepower of a compressor, respectively. l1, ij, l2, ij and l3, ij are the gas compressor coefficients between node i-j. Also, α1, ij, α2,ij and α3,ij are coefficients related to compressor horsepower between i-j. In addition, the limit of the compressor ratio PRijtComp,up is as Eq (A-9) in S1 Appendix. Eqs (A-5), (A-7) and (A-8) in S1 Appendix are the first group of non-linear equations in this paper, which should be converted into a suitable linear form for linear programs of integers. For (A-5) and (A-7), we apply the linearization process used with two and three variables, which is based on the Taylor series. In addition, for equations with the form of quadratic functions such as (A-8), the piecewise linear approximation method is used to convert the nonconvexity of (A-8) into convexity. _3.1.2.3. Distributional robust chance constrained (DRCC) modeling_ . The DRCC method has been introduced as one of the powerful techniques for modeling probability-based constraint problems. Due to the fluctuating behavior of uncertain parameters, satisfying the constraints including them will also be possible. The DRCC method is used for problems with probabilistic constraints to not only deal with the uncertain nature of these problems, but also to maximize the MG profit with a certain probability according to the robustness of the system. The mathematical formulas of this method will be explained in this section. At first, it is assumed that the vector has random variables φ with the Eq (A-10) in S1 Appendix, where φ and σ <sup>2</sup> represent the mean and variance, respectively. Family D is all distributions with mean φ and variance σ <sup>2</sup> . We denote this family by D(φ,σ <sup>2</sup> ) and the DRCC method for each φ _�_ (0,1) according to the mentioned information is defined as Eq (A-11) in S1 Appendix. This equation is equivalent to the adverb of the convex second order cone as Eq (A-12) in S1 Appendix where, φ is the probability of satisfying constraints with uncertain parameters. 3.2. Micro-grid optimum planning In this section, optimal planning for MG will be described. 3.2.1. Upper level (UL) problem. In this paper, the market structure of day-ahead (DA) and real-time balance (RTB) is used. In the DA and wholesale gas markets, MGs maximize their profits by optimizing the bidding strategy within the time frame. The optimal MG planning objective function in the high-level problem (first stage) is formulated as follows: In addition, the limit of the compressor ratio PRijt <sup>_DA_</sup> _t_ <sup>_:P_</sup> _iM_ <sup>_Bid_</sup> _;_ _iM_ <sup>_Bid_</sup> _;t_ <sup>_:_</sup> <sup>D</sup> <sup>_t_</sup> <sup>þ</sup> _OBJiM_ <sup>_UP_</sup> <sup>¼</sup> _OBJiM_ <sup>_UP_</sup> X _T_ r <sup>_DA_</sup> _t_ _t_ ¼1 X _L_ r <sup>_RT_</sup> _t_ X _T_ <sup>_RT_</sup> _t_ <sup>_:P_</sup> _jt_ <sup>_De_</sup> <sup>_RT_</sup> _t_ <sup>_:P_</sup> _jt_ <sup>_IL_</sup> r <sup>_RT_</sup> _t_ _jt_ <sup>_De:_</sup> <sup>D</sup> <sup>_t_</sup> <sup>Þ �ð</sup> X _L_ X _T_ _jt_ <sup>_IL:_</sup> <sup>D</sup> <sup>_t_</sup> <sup>Þ�þ</sup> þ½ð _j_ ¼1 _t_ ¼1 _j_ ¼1 _t_ ¼1 X _T_ X _L_ _t_ <sup>Im</sup> <sup>_ba_</sup> _jt_ <sup>_IL_</sup> <sup>�</sup> ð5Þ X _T_ _Costjt_ <sup>_IL_</sup> X _T_ X _T_ _CostiM_ <sup>_BESS_</sup> _;t_ _iM_ <sup>_BESS_</sup> _;t_ <sup>�</sup> _CostiM_ <sup>_DG_</sup> _;_ _iM_ <sup>_DG_</sup> _;t_ <sup>þ</sup> þ þ _Costt_ <sup>Im</sup> <sup>_ba_</sup> _t_ ¼1 X _L_ X _T_ _j_ ¼1 _t_ ¼1 _t_ ¼1 _t_ ¼1 X _L_ r <sup>_Gas_</sup> _t_ <sup>_;retail_</sup> <sup>_Gas_</sup> _t_ <sup>_;retail_</sup> _:PGas_ <sup>_De_</sup> r <sup>_Gas_</sup> _t_ <sup>_Gas_</sup> _t_ <sup>_:P_</sup> _Gas_ <sup>_Gen_</sup> X _T_ _Gas_ <sup>_De_</sup> _;ijt_ <sup>�</sup> X _L_ X _L_ _Gas_ <sup>_Gen_</sup> _;ijt_ 8 _iM_ _i_ ¼1 _j_ ¼1 _t_ ¼1 _i_ ¼1 _j_ ¼1 _t_ ¼1 [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 9 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas where ρtRT and ρtGas,retail are the retail prices of electricity and gas, and ρtGas is the price of gas in the wholesale gas market. T is the timing interval of DA. PGas,ijtDe and PGas,ijtGen are the RT and ρt De and PGas,ijt where ρt Gas,retail are the retail prices of electricity and gas, and ρt in the wholesale gas market. T is the timing interval of DA. PGas,ijtDe and PGas,ijtGen are the amount of gas demand and production. In the objective function, the first term is the income (cost) of selling (buying) electric energy from (by) the MG to (from) the distribution network. The second term is the income from the sale of electrical energy to consumers. The next four terms are the imbalance cost, IL, BESS, and DG units, respectively. The last two periods are the income from selling gas to gas consumers and the cost of buying gas from the wholesale gas market. According to what was said, when ΔPtImba _<_ 0, the MG needs to purchase energy shortages in the RTB market, and the sign of CosttImba in (3) will be negative, which is the imbalance According to what was said, when ΔPt in the RTB market, and the sign of CosttImba in (3) will be negative, which is the imbalance cost for MGs to apply the mentioned cost in the objective function. The sign of the third part (5) must be positive, which becomes a negative sign in the presence of CosttImba. After solving (5) must be positive, which becomes a negative sign in the presence of CosttImba. After solving the problem, the value of the mentioned variables is determined and all of them are considered to minimize the power deviation cost in the second stage problem. In the high-level DA scheduling problem, the model is considered as a here-and-now decision process. The cost function CostjtIL has a direct dependence on the amount of interrupted load and is modeled as Eq (A-13) in S1 Appendix, where α1jIL and α2jIL are coefficients based on IL cost. The cost function Costjt IL and α2j modeled as Eq (A-13) in S1 Appendix, where α1jIL and α2jIL are coefficients based on IL cost. The cost function of CostiM,tBESS is considered as a linear function and can be modeled as The cost function of CostiM,tBESS is considered as a linear function and can be modeled as Eqs (A-14) and (A-15) in S1 Appendix, where PiM,tBESSis the charge or discharge of power in Eqs (A-14) and (A-15) in S1 Appendix, where PiM,tBESSis the charge or discharge of power in the BESS at time t in the iM MG. EsiM,tBESS and ηLIf are stored energy and leakage loss coeffi the BESS at time t in the iM MG. EsiM,tBESS and ηLIf are stored energy and leakage loss coeffi cient in BESS, respectively. BLDiMBESS is the BESS lifetime degradation cost factor. LCNBESS, cient in BESS, respectively. BLDiMBESS is the BESS lifetime degradation cost factor. LCNBESS, BIC and ERCBESS are the life cycle number, investment cost and rated energy capacity of BESS, BIC and ERCBESS are the life cycle number, investment cost and rated energy capacity of BESS, respectively. The first and second terms of (A-14) derive the cost of the BESS from its charge/ discharge and the energy stored in the BESS, taking into account the leakage loss factor. The DG unit is considered as a gas burning system and its cost function is formulated by a quadratic function as Eqs (A-16) and (A-17) in S1 Appendix, where XiM,tDG, XiM,tSD and XiM, tSU, respectively provide binary variables that provide DG on/off status, shutdown and startup decisions. SUCiM,tDG and SDCiM,tDG are the startup and shutdown costs of DG units. α1jDG, SD and XiM, DG, XiM,t t decisions. SUCiM,tDG and SDCiM,tDG are the startup and shutdown costs of DG units. α1jDG, α2jDG and α3jDG are the coefficients based on the unit cost of DG in iM MG at time t. α2jDG and α3jDG are the coefficients based on the unit cost of DG in iM MG at time t. To obtain the uncertainty parameters, the DRCC method should be applied to the problem formulations. At first, the total profit of the MG F in the DA scheduling problem is given as Eq (A-18) in S1 Appendix. DG and α3j DG and SDCiM,t DG are the startup and shutdown costs of DG units. α1j To use the DRCC method, the auxiliary variable Z to maximize the profit of the MG is defined as Eq (A-19) in S1 Appendix, where φ is the level of confidence determined by the decision maker based on the strength of the system. Therefore, the main objective function after applying DRCC is as Eq (A-20) in S1 Appendix, where σρ <sup>DA</sup> t <sup>and σρGas</sup> t <sup>are the standard</sup> t <sup>and σρGas</sup> after applying DRCC is as Eq (A-20) in S1 Appendix, where σρ <sup>DA</sup> t <sup>and σρGas</sup> t <sup>are the standard</sup> deviations of DA market and gas prices, respectively. Obtaining a certain amount of profit for MGs is guaranteed by the DRCC method; because in the worst case, uncertain parameters in the system are obtained by considering specific values for the mean and variance of each uncertain parameter and a certain value from it. The confidence level determined by the decision maker. If the mean and variance values for uncertain parameters change based on the energy market and geographic conditions, or the level of confidence changes by the decision maker, it is obvious that the benefit will be for MGs. In new conditions, the system is guaranteed due to considering the worst cases of all uncertain parameters. The complete constraints related to the high-level problem are also stated as follows. _3.2.1.1. Electric energy balance limitation_ . The limit of electrical energy balance is expressed as Eq (A-21) in S1 Appendix. [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 10 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas _3.2.1.2. Wind power limitation_ . The limit of wind power is expressed as Eqs (A-22) and (A23) in S1 Appendix, where, QiM,tWind is the output reactive power of the wind turbine at bus i and at time t. After applying the DRCC method, the new wind power limit will be as Eq (A-24) in S1 Appendix, where PiM,tWind,UP, ω and σPWind,UPiM,t <sup>are the upper limit, confidence level and</sup> Wind,UP, ω and σPWind,UP Appendix, where PiM,tWind,UP, ω and σPWind,UPiM,t <sup>are the upper limit, confidence level and</sup> standard deviation of wind power, respectively. _3.2.1.3. Solar cell power limitation_ . The limitation of solar cell power is expressed as Eq (A25) in S1 Appendix, where SOL, SPV, and ηPV are solar radiation, PV panel size, and PV efficiency, respectively. After applying the DRCC method, the limitation of the new PV panel is expressed as Eq (A26) in S1 Appendix, where ɘ and σSOLt are the confidence level of PV and the standard deviation of SOLt at time t, respectively. _3.2.1.4. Dispersed production unit limitation_ . The limitation of distributed production unit is stated as Eqs (A-27)-(A-37) in S1 Appendix, where PiM, PiM,tDG and PiM,tDG show, respec is stated as Eqs (A-27)-(A-37) in S1 Appendix, where PiM, PiM,tDG and PiM,tDG show, respec tively, the lower and upper limit of DG power in iM MG at time t. PGas,iM,tDe,DG is the gas DG and PiM,t tively, the lower and upper limit of DG power in iM MG at time t. PGas,iM,tDe,DG is the gas demand of the DG unit. HRa <sup>Gas</sup> is the gas heating rate (MW/GJ). RaiMDG,Up and RaiM DG,Up and RaiM DG,Down are the up and down ramps of DG in iM MG. MUTiM and MDTiM are minimum upper and lower limits of DG. e is an index to model the minimum upper and lower bounds running from 1 to Max{MUTiM,MUTiM}. _3.2.1.5. BESS energy storage system limitation_ . The limitation of the energy storage system is stated as Eqs (A-38)-(A-42) in S1 Appendix, where, η <sup>CIf</sup> is the loss coefficient related to the charging or discharging state of the BESS. In this research, the value of the loss coefficient is assumed to be constant. PiM,tChr,BESS and PiM,tDis,BESS are the maximum charge and discharge assumed to be constant. PiM,tChr,BESS and PiM,tDis,BESS are the maximum charge and discharge power of BESS. a and b are auxiliary variables that are used to remove the absolute function. Eq (A-38) in S1 Appendix shows the limit of BESS energy balance. Eqs (A-39) to (A-40) in S1 Appendix show the state of load restrictions and (A-41) shows the discharge or charging capacity. Finally, the final and initial energy stored in the BESS are given in (A-42). _3.2.1.6. IL flow limitation_ . To ensure the stability of the power grid in emergency situations (for example, when the sum of electricity produced and energy received from the main grid is less than energy consumption), the possibility of load reduction is also considered for energy balance in the grid. The presence of random producers whose restrictions are as Eqs (A-43)(A-44) in S1 Appendix. Eqs (A-43) and (A-44) in S1 Appendix state that the value of IL must be kept within the permissible range. Chr,BESS and PiM,t _3.2.1.7. Electric energy network limitation_ . The eqations of AC current in each bus and at time t are formulated as Eqs (A-45)-(A-51) in S1 Appendix, where PitInjecte(Vit,θit) and QitInjec Injecte(Vit,θit) and Qit Injec te(Vit,θit) correspond to active and reactive power injection in bus i at time t, respectively. PitDe and QitDe show active and reactive power demand. Eqs (A-49) to (A-51) in S1 Appendix express the allowed changes of mixed power, voltage magnitude and voltage angel, respectively. _3.2.1.8. Gas network limitation_ . The limitation of the gas network is expressed as Eqs (A52)-(A-55) in S1 Appendix, where PGas,ijtDe and PGas,ijtDe,Heat are the total energy demand and heating energy load at time t, respectively. Eqs (A-52) and (A-53) in S1 Appendix express gas node balance and demand limits, respectively. Eqs (A-54) and (A-55) in S1 Appendix express LP changes, initial and final energy of LP limits, respectively. _3.2.1.9. Connection exchanges limitation_ . The limit of connection exchanges is stated as Eq (A-56) in S1 Appendix, where, the lower and upper lines are the minimum and maximum amount of energy exchange in the energy market, respectively. 3.2.2. Lower level (LL) problem. In the RTB market, the power balance can be created by optimal planning in the timing horizon. It is assumed that this market is very high. Every 5 minutes after determining the value of binary variables by solving the proposed optimal model [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 11 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas in the high-level problem, all MGs should adjust their controllable devices such as DG unit to compensate for power deviations in the real-time balancing market. In the lower level problem, the relationship is expressed as follows: _Min_ _OBJ_ <sup>_LO_</sup> ¼ X _T_ _t_ ¼1 _Costt_ <sup>Im</sup> <sup>_ba_</sup> ð6Þ where CosttImba is the cost of disequilibrium in the lower level problem. The complete con straints of Eq (6) include Eqs (A-21) to (A-30) in S1 Appendix, Eqs (A-38) to (A-41) in S1 Appendix and Eqs (A-43) to (A-55) in S1 Appendix. Since the main goal in the second stage is to minimize the imbalance costs by minimizing the amount of power deviations, the value of PiM,tBid (which is determined in the problem of the amount of power deviations, the value of PiM,tBid (which is determined in the problem of the first stage) in Eq (A-57) in S1 Appendix is used for this purpose. Therefore, the value of PtRT is updated by adjusting the DERs schedules in (A-58) considering the value of PiM,tBid RT is updated by adjusting the DERs schedules in (A-58) considering the value of PiM,t Bid with the aim of minimizing the power deviations without changing the state of the DG units that were previously determined in the first. Phase problem by minimizing the amount of power deviations, the amount of unbalance costs is also minimized according to (A-59). 3.3. Micro-grid energy price The average of energy price (EP) is shown in Fig 3. This value is adopted in the year according to the data obtained from 2020. As can be seen, the value of this index is changing during one <u>Fig 3.</u> <u>Energy price during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g003](https://doi.org/10.1371/journal.pone.0309999.g003) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 12 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas day, and during peak hours, the EP consumption is higher than during off-peak hours. These values have an impact on the cost of the MG. In other words, if the load of the MG is high during peak hours, the cost of the MG will increase. Now, by achieving the production capacity of each power plant according to the above procedure and also considering the EP according to the above figure, the production cost of each power plant during one day can be obtained according to the following relationship: _Price_ <sup>_j_</sup> ¼ X24 _i_ ¼1 _P_ _i_ ¼ _hour_ _j_ ¼ _Power Plant Type_ _ij_ <sup>_EP_</sup> _i_ <sup>_;_</sup> ð7Þ where Price <sup>j</sup> is the cost of the j-th power plant, Pij is the power value of the same power plant in the i-th hour, and EPi is the energy price in the i-th hour. 4. Simulation results The simulation related to this research is coded in Games software and as a mixed integer non-linear programming (MINLP). The reason for using this software is its ability to solve non-linear problems and optimization. The efficiency of gas turbines and fuel cells (FC) depends on their working point, and considering the exact model of these sources and the relationships related to the calculation of their fuel consumption is non-linear. On the other hand, a binary variable has been used to show the charging and discharging state of the storage tank and the on-and-off state of the gas turbines. Therefore, our problem is an MILP. There are several solvers in Games to solve MILP problems: - DICOPT solver has a very good speed. - The COUENNE solver has been used to solve the problem, which has a good performance, but the speed of its solution is a little slow. According to what was said, to electrify the load in this article, it is necessary to feed this power by the following power plants: - Production power of micro-turbine 1 (MT1) - Production power of micro-turbine 2 (MT2) - Production power of micro-turbine 3 (MT3) - Production power of solar cell - Production power of wind turbine - Production power of fuel cell - Power of charging and discharging energy storage The simulation performed in this paper was tested on a 33-bus IEEE radial distribution system and its information can be accessed in [32]. The general schematic of this micro-grid is according to Fig (2). Also, the load profile of this network has been used based on [33]. The safety pressure and diameter for gas pipelines are 140 kPa and 660 mm, respectively. Information related to wind turbine sources as well as distributed generation units is given in [34]. In addition, the price of natural gas can be seen in [35]. Now, the results of this simulation will be examined in Gomes software, including the amount of load power and each of the above production powers. [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 13 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas 4.1. Power consumer values The amount of consumer power or consumption demand, in the network under investigation, during 24 hours a day, is specified in this section. This consumer data can be checked in the following two scenarios: - Optimized demand - Un-optimized demand These load data during the period of 24 hours and in the two stated scenarios will be in the form of Fig 4. According to this figure, it can be seen that the non-optimized load has more load power than the optimized load power. Also, the load capacity increases after 16:00 and the amount of load in state un-optimized demand shows less fluctuation in other words, consumption optimization has not been done. In the morning hours, the amount of load power is high. 4.2. Power producer values As mentioned, the data values of the producers include 7 production sources of MT1, MT2, MT3, solar cell, wind turbine, fuel cell and storage energy source. Based on this, in this section and in the following, the details of the production power of each of these sources will be discussed after optimization in GAMS software. 4.2.1. MT1 power producer values. The production power value of MT1 after optimization is specified in this section in the form of a correct mixed non-linear programming in <u>Fig 4.</u> <u>Load data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g004](https://doi.org/10.1371/journal.pone.0309999.g004) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 14 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 5.</u> <u>MT1 production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g005](https://doi.org/10.1371/journal.pone.0309999.g005) GAMS software and during 24 hours. This production data will be in the Fig 5. According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night. The reason for the high fluctuation in this power generation is the peak load during the day and the related optimization issue. 4.2.2. MT2 power producer values. The production power value of MT2 after optimization is specified in this section in the form of a correct mixed nonlinear programming in GAMS software and during 24 hours. This production data will be in the Fig 6. According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night. 4.2.3. MT3 power producer values. The production power value of MT3 after optimization is specified in this section in the form of a MINLP in GAMS software and during 24 hours a day. This production data will be in the Fig 7. According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night. According to Figs 5–7, it can be seen that three situations MT1-MT3 have similar behavior and all three have little production in the early hours of the day and their production increases in the later hours. 4.2.4. Photovoltaic power producer values. The amount of solar cell production power after optimization is specified in this section in the form of a correct mixed nonlinear programming in the Gomes software and during 24 hours a day. This production data will be in the Fig 8. According to this figure, it can be seen that this production source starts producing [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 15 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 6.</u> <u>MT2 production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g006](https://doi.org/10.1371/journal.pone.0309999.g006) <u>Fig 7.</u> <u>MT3 production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g007](https://doi.org/10.1371/journal.pone.0309999.g007) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 16 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 8.</u> <u>PV production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g008](https://doi.org/10.1371/journal.pone.0309999.g008) power during the hours of the day when the sun starts to shine, and when the sun’s radiation decreases, its production power becomes zero. 4.2.5. Wind turbine power producer values. The amount of wind turbine production power after optimization is specified in this section in the form of a correct MINLP in Gomes software and during 24 hours a day. This production data will be in the Fig 9. According to this figure, it can be seen that in some hours of the day and night when the wind speed increases, the amount of power produced from this source has also increased, and this amount of power may be completely different on another day. In other words, the power produced by the wind turbine source depends on the wind speed and does not depend on the hours of the day. 4.2.6. Fuel cell power producer values. The output power of the fuel cell after optimization is specified in this section in the form of a MINLP in GAMS software and during 24 hours a day. This production data will be in the Fig 10. According to this figure, it can be seen that the power generated from this source of power generation is turned off at night and does not generate power. 4.2.7. Energy storage power producer values. The amount of power and energy charged and discharged of the energy storage after optimization is specified in this section in the form of a correct MINLP in GAMS software 24 hours a day. The data of the charged and discharged power of the energy storage will be as shown in fig 11. Positive values in this figure indicate the discharge status of the energy storage system and negative values indicate the charging status [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 17 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 9.</u> <u>Wind turbine production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g009](https://doi.org/10.1371/journal.pone.0309999.g009) of the energy storage system. According to this figure, it can be seen that the power charged or discharged from this energy source depends on the difference between the power produced from other sources and the power consumed by the load. In other words, if the amount of power generation is more than the load, the energy storage system will be charged, and on the contrary, if the amount of load is more than the power production, the energy storage system will be discharged. Also, the energy data of the energy storage will be in the Fig 12. 5. Discussion In this section, the results obtained in the previous sections will be discussed. Based on this, at first, we will obtain the total production power from the sources of MT1, MT2, MT3, solar energy, wind energy, and fuel cells. Then, the difference between this value with the charge and discharge power values of the energy storage system is obtained to see whether this energy storage source correctly detects charging and discharging or not. For this purpose, fig 13 shows the total production power from the 6 sources mentioned above during a period of 24 hours a day. Fig 14 also shows the difference in the amount of power produced by six power generation and the load in the non-optimized scenario. According to this figure, it can be seen that this amount of power expresses the amount of charging and discharging of the energy storage source. In other words, this difference is the lack or excess of power in the network, which [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 18 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 10.</u> <u>Fuel cell production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g010](https://doi.org/10.1371/journal.pone.0309999.g010) needs to be charged and discharged by the energy storage source. According to this figure, it can be seen that this figure is similar to Figs (5–9) with an acceptable approximation. The relative difference between these two forms is caused by the inertia of the energy storage source that will change its state. Now, according to fig 14, it can be seen that there is no significant difference between the power produced by the six production sources and the load power, and this optimization procedure can be fully used. Also, according to the reference [2] that the data was extracted according to this reference, it can be seen that the network costs will be significantly reduced with the optimization done in this article. In other words, if the appropriate wind and solar production power was not used optimally in this article, as in reference [2], it was necessary to use the energy of microturbines to produce electric power, which is extremely expensive. It increased the network. The amount of produce price of a power plant in the MG is obtained according to Table 2. As can be seen: - The economic efficiency of micro-turbines is higher than other power plants due to continuous power generation. [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 19 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 11.</u> <u>Charging and discharging energy storage production power data during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g011](https://doi.org/10.1371/journal.pone.0309999.g011) <u>Fig 12.</u> <u>Energy data of energy storage production during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g012](https://doi.org/10.1371/journal.pone.0309999.g012) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 20 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 13.</u> <u>Total production capacity during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g013](https://doi.org/10.1371/journal.pone.0309999.g013) - The economic efficiency of the solar cell is relatively suitable because it produces power during peak load times (note that the solar cell produces power only in limited hours of the day and yet it has a significant amount of economic efficiency). - The amount of power produced by the battery storage is low due to being discharged every moment, although it plays a significant role in smoothing the production power of the network. Table 2. _Price of power plant_ . <u>No.</u> <u>Power Plant Type</u> <u>Price (USD)</u> <u>1</u> <u>MT1</u> <u>29900</u> <u>2</u> <u>MT2</u> <u>22687</u> <u>3</u> <u>MT3</u> <u>23304</u> <u>4</u> <u>PV</u> <u>9875.7</u> <u>5</u> <u>WT</u> <u>12274</u> <u>6</u> <u>FC</u> <u>15630</u> <u>7</u> <u>BESS</u> <u>847.2</u> [https://doi.org/10.1371/journal.pone.0309999.t002](https://doi.org/10.1371/journal.pone.0309999.t002) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 21 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas <u>Fig 14.</u> <u>All power production and load power differences in non-optimized scenario during 24 hours.</u> [https://doi.org/10.1371/journal.pone.0309999.g014](https://doi.org/10.1371/journal.pone.0309999.g014) 6. Conclusion In this article, an attempt was made to code the simulation in the form of an MILP using GAMS software. Based on this and according to the output of this software, the amount of power difference between generators and load using GAMS problem optimization, the charge and discharge values of energy storage have been expressed. In other words, this difference is the lack or excess of power in the network, which needs to be charged and discharged by the energy storage source. The results of this optimization were verified according to the charging and discharging output of the energy storage device. The relative difference was caused by the inertia of the energy storage source. By precisely defining the optimization problem and extracting the objective function, the amount of production of each electrical energy generating unit with two issues of electricity and gas during 24 hours was accurately obtained. According to the results of this article, it is possible to accurately determine the amount of production of each resource to reach the optimal cost amount during the 24 hours. With this analysis, network costs will be significantly reduced by combining gas and electricity. In other words, it is possible to go to gas power plants during the hours when electricity is needed and use relatively cheaper energy such as solar energy during the day, thus increasing network costs. With optimal energy consumption and management of the production side, network costs can be optimized and this cost can be transferred to investment in other sectors. The method proposed in this article is based on mathematics and due to the use of software based on optimization, the accuracy of its results is high. [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 22 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas Supporting information [S1 Data. Microgrid_Gas.gms. GAMS code of micro-grid.](http://www.plosone.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pone.0309999.s001) (M) [S2 Data. Power_Tolid.Masraf.m. MATLAB code of figure.](http://www.plosone.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pone.0309999.s002) (GMS) [S3 Data. Main.m. MATLAB code of figure.](http://www.plosone.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pone.0309999.s003) (M) [S1 Appendix.](http://www.plosone.org/article/fetchSingleRepresentation.action?uri=info:doi/10.1371/journal.pone.0309999.s004) (DOCX) Author Contributions Conceptualization: Shahryar Behnia, Saeed Kharrati. Data curation: Shahryar Behnia. Formal analysis: Shahryar Behnia. Funding acquisition: Shahryar Behnia. Investigation: Shahryar Behnia. Methodology: Shahryar Behnia. Project administration: Saeed Kharrati. Software: Shahryar Behnia. Supervision: Saeed Kharrati, Farshad Khosravi, Abdollah Rastgou. Validation: Shahryar Behnia. Visualization: Shahryar Behnia, Farshad Khosravi, Abdollah Rastgou. Writing – original draft: Shahryar Behnia. Writing – review & editing: Shahryar Behnia. References 1. Mohammad M, Younes N, Behnam MI. Energy hub: From a model to a concept–A review. Renewable and Sustainable Energy Reviews. 2017; 80: 1512–27. 2. Tengfei M, Junyong W, Liangliang H. Energy flow modeling and optimal operation analysis of the micro energy grid based on energy hub. Energy Conversion and Management. 2017; 133: 292–306. 3. Huang Wujing, Zhang Ning, Yang Jingwei, Wang Yi, Kang Chongqing. Optimal Configuration Planning of Multi-Energy Systems Considering Distributed Renewable Energy. IEEE Transactions on Smart Grid. 2019; 10(2):1452–64. 4. Seyed MZ, Nirajan S and Peter S. Simulation Scenario Analysis of Operational Day to Day Storage System of Biomass Supply Chain for a Power Plant Case Study Based on Logistic Cost and Transportation Emissions. 2021 International Conference on Advances in Electrical, Computing, Communication and [Sustainable Technologies (ICAECT). Bhilai, India. 2021:1–8; https://doi.org/10.1109/ICAECT49130.](https://doi.org/10.1109/ICAECT49130.2021.9392411) [2021.9392411](https://doi.org/10.1109/ICAECT49130.2021.9392411) 5. Liang S, Zhu J. Dynamic Economic Dispatch of Microgrid with Biomass Power Generation. 6th International Conference on Energy and Environmental Protection. Proceedings of the 2017 6th International Conference on Energy and Environmental Protection (ICEEP 2017). 6. Hosseinpour S., Haji Seyed Mirza Hosseini S. A., Mehdipour R., Hemmasi A. H., Ozgoli H. A. Energy Modeling and Techno-Economic Analysis of a Biomass Gasification-CHAT-ST Power Cycle for [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 23 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas Sustainable Approaches in Modern Electricity Grids. _Journal of Renewable Energy and Environment_, 2020; [7(2): 43–51. https://doi.org/10.30501/jree.2020.106780](https://doi.org/10.30501/jree.2020.106780) 7. Yousif M, Ai Q, Gao Y, Wattoo WA, Jiang Z, Hao R. Application of Particle Swarm Optimization to a Scheduling Strategy for Microgrids Coupled with Natural Gas Networks. _Energies_ . 2018; 11(12):3499. [https://doi.org/10.3390/en11123499.](https://doi.org/10.3390/en11123499) 8. Ronia MS, Thompsonb DN, Hartleyb DS. Distributed biomass supply chain cost optimization to evalu[ate multiple feedstocks for a biorefinery. 2019;254. https://doi.org/10.1016/j.apenergy.2019.113660](https://doi.org/10.1016/j.apenergy.2019.113660) 9. Zhou B, Xu D, Li C, Chung CY. Optimal Scheduling of Biogas-Solar-Wind Renewable Portfolio for MultiCarrier Energy Supplies. 2018; 33(6):6229–39. 10. Djurovic Z M MILACIC A & KRSULJA M. A Simplified Model Of Quadratic Cost Function For Thermal Generators. Annals & Proceedings of DAAAM International. 2012; 23(1):00–25. 11. Li R, Wei W, Mei S, Hu Q, Wu Q. Participation of an Energy Hub in Electricity and Heat Distribution Markets: An MPEC Approach. IEEE Transactions on Smart Grid. 2019; 10(4): 3641–53. 12. Dini A, Pirouzi S, Norouzi M, Lehtonen M. Grid-Connected Energy Hubs in the Coordinated Multi[Energy Management Based on Day-Ahead Market Framework. Energy. 2019; 188(1). https://doi.org/](https://doi.org/10.1016/j.energy.2019.116055) [10.1016/j.energy.2019.116055](https://doi.org/10.1016/j.energy.2019.116055) 13. Luo W, Zhang X, Yang D, Sun Q. Emission Trading Based Optimal Scheduling Strategy of Energy Hub with Energy Storage and Integrated Electric Vehicles. Journal of Modern Power System and Clean Energy. 2020; 8(2):267–75. 14. Ghalelou AN, Nojavan S, Zare K, Ivatloo BM. Robust Scheduling of Thermal, Cooling and Electrical Hub Energy System under Market Price Uncertainty. Applied Thermal Engineering. 2019; 149 (25):862–80. 15. Eladl AA, Afifi MIE, Saadawi MME, Sedhom BE. A Review on Energy Hubs: Models, Methods, Classification, Application, and Future Trends. Alexandria Engineering Journal. 2023; 68(1):315–42. 16. Salehi J, Namvar A, Gazijahani FS, Khah MS, Caraloa JPS. Effect of Power-to-Gas Technology in [Energy Hub Optimal Operation and Gas Network Congestion Reduction. Energy. 2022; 240(1). https://](https://doi.org/10.1016/j.energy.2021.122835) [doi.org/10.1016/j.energy.2021.122835.](https://doi.org/10.1016/j.energy.2021.122835) 17. Mohmoudian M, Sadi S, Gholami J, Karimi A. Sensitivity Analysis in a Multi-Carrier Energy Hub System through Electrical and Thermal Profile Procurement. Renewable Energy Research and Application (RERA). 2022; 3(2):217–28. 18. Mugbel A, Awami ATA, Parvania M. Optimal Planning of Distributed Battery Energy Storage Systems in Unbalanced Distribution Networks. IEEE Systems Journl. 2021; 16(1):1194–1205. 19. Alobaidi AH, Khodayar ME, Shahidehpour M. Decentralized Energy Management for Unbalanced Networked Microgrids with Uncertainty. IET Generation, Transmission & Distribution. 2021; 15(13):1922– 38. 20. Mohamed AAR, Best RJ, Morrow DJ, Cupples A, Bailie I. Impact of the deployment of Solar Photovoltaic and Electrical Vehicle on the Low Voltage Unbalanced Networks and the Role of Battery Energy [Storage Systems. Journal of Energy Storage. 2021;42. https://doi.org/10.1016/j.est.2021.102975.](https://doi.org/10.1016/j.est.2021.102975) 21. Rajesh P, Naveen C, Venkatesan AK, Shajin FH. An Optimization Technique for Battery Energy Storage with Wind Turbine Generator Integration in Unbalanced Radial Distribution Network. Journal of [Energy Storage. 2021;43. https://doi.org/10.1016/j.est.2021.103160.](https://doi.org/10.1016/j.est.2021.103160) 22. Zheng Y, Song Y, Huang A, Hill DJ. Hierarchical Optimal Allocation of Battery Energy Storage Systems for Multiple Services in Distribution Systems. IEEE Transactions on Sustainable Energy. 2020; 11 (3):1911–21. 23. Nayak MR, Behura D, Nayak S. Performance Analysis of Unbalanced Radial Feeder for Integrating Energy Storage System with Wind Generator using Inherited Competitive Swarm Optimization Algo[rithm. Journal of Energy Storage. 2021;38. https://doi.org/10.1016/j.est.2021.102574.](https://doi.org/10.1016/j.est.2021.102574) 24. Aranizadeh A, Vahidi B, Rahiminejad A. Wind turbine power output smoothing in microgrid using ultracapacitor with continuous wind speed forecasting and online supervisory control. Journal of Renewable [and Sustainable Energy. 2016;8(3). https://doi.org/10.1063/1.4950958.](https://doi.org/10.1063/1.4950958) 25. Aranizadeh A, Zaboli A, Gashteroodkhani OA, Vahidi B. Wind turbine and ultra-capacitor harvested energy increasing in microgrid using wind speed forecasting. Engineering science and technology, an international journal. 2019; 22(5):1161–67. 26. Aranizadeh A, Shahrtash SM, Gholami A. Comprehensive Condition Assessment of Circuit Breakers in a Power Network for Maintenance Scheduling. IET Generation Transmission & Distribution. 2023; 17 (15):63–3476. 27. Aranizadeh A, Shahrtash SM, Gholami A. Prioritizing CBs maintenance and identifying mandatory maintenance at higher priorities. International Transaction Electrical Energy System. 2022; 2022. [https://doi.org/10.1155/2022/5008166.](https://doi.org/10.1155/2022/5008166) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 24 / 25 PLOS ONE Simultaneous costs minimizing in electricity and gas 28. Noroznia H, Gandomkar M, Nikoukar J, Aranizadeh A, Mirmozaffari M. A Novel Pipeline Age Evaluation: Considering Overall Condition Index and Neural Network Based on Measured Data. _Machine_ _Learning and Knowledge Extraction_ . 2023; [5(1):252–268. https://doi.org/10.3390/make5010016.](https://doi.org/10.3390/make5010016) 29. Lotfi H. Multi-objective energy management approach in distribution grid integrated with energy storage units considering the demand response program. International Journal of Energy Research. 2020; 44 (13):10662–81. 30. Lotfi H, Ghazi R. Optimal participation of demand response aggregators in reconfigurable distribution system considering photovoltaic and storage units. Journal of Ambient Intelligence and Humanized Computing. 2020; 12:2233–55. 31. Nikkhah MH, Lotfi H, Samadi M, Hajiabadi ME. Energy Hub Management considering Demand [Response, Distributed Generation, and Electric Vehicle Charging Station. 2023;2023. https://doi.org/](https://doi.org/10.1155/2023/9042957) [10.1155/2023/9042957.](https://doi.org/10.1155/2023/9042957) 32. Daneshvar M, Babaei E. Exchange Market Algorithm for Multiple DG Placement and Sizing in a Radial Distribution System. Journal of Energy Management and Technology. 2018; 2(1):54–65. 33. Chen Y, Hu M. Balancing collective and individual interests in transactive energy management of interconnected micro-grid clusters. Energy. 2016; 109(15):1075–85. 34. Luo F, Dong ZY, Meng K et al. Short-term operational planning framework for virtual power plants with high renewable penetrations. IET Renewable Power Generation. 2016; 10(5):623–33. 35. Daneshvar M, Pesaran M, Mohammadi-ivatloo B. Transactive energy integration in future smart rural [network electrification. Journal of Cleaner Production, 2018; 190:645–54. https://doi.org/10.1016/j.](https://doi.org/10.1016/j.jclepro.2018.04.043) [jclepro.2018.04.043.](https://doi.org/10.1016/j.jclepro.2018.04.043) [PLOS ONE | https://doi org/10 1371/journal pone 0309999](https://doi.org/10.1371/journal.pone.0309999) September 19 2024 25 / 25

섹션 본문 121문단 · 45,976자

(제목 없음)

1Distributed generation can actively participate in the day-ahead markets, real-time power balance, and wholesale gas markets to achieve various goals, such as supplying gas to various electric power generation plants.A multi-objective network with two types of loads is considered in this paper.The reason for the simultaneous optimization of these two networks is that these two energy carriers are dependent on each other and gas is needed to produce electricity, so this issue can be addressed with a multi-objective function.The simulation carried out in this article is coded in GAMS software as a mixed integer linear programming (MILP).The efficiency of gas turbines and fuel cells in this article is dependent on their working point, and considering the exact model of these resources and the relationships related to the calculation of their fuel consumption is non-linear.On the other hand, a binary variable has been used to show the charging and discharging state of the storage and the on-and-off state of the gas turbines.Therefore, the problem considered in this article is a MILP problem.The results of this article are the proper planning of charging and discharging of the energy storage system with the proper planning of the power generation of different energy sources considering the network loads in two optimized and non-optimized scenarios.

Introduction

2Undoubtedly, one of the main challenges in the last century is the energy challenge.This challenge in various fields of energy, including energy supply, exchange and consumption, due to population growth, increasing global demand for energy, lack of fossil fuels and environmental pollution, and concern about energy security for all countries of the world, has become an important topic.The close relationship of energy with economy, social, environmental and security aspects has doubled its importance.Energy-related issues are important issues in this field, for example, we can refer to issues such as energy security, fair distribution, affordability, reliability, efficiency, and suitability for the environment [1].

3Producing electricity near the place of consumption, in addition to reducing losses in the system, can have more flexibility to provide various services to consumers.With the increasing penetration of distributed generation (DG) in power grids and considering different technologies, the uncertainties of its renewable types, Major challenges are raised for the design of power systems in the future.One of the methods of aggregating distributed generation resources is a concept called micro-grid (MG).MGs are low-voltage and medium-voltage active distribution networks that consist of a set of loads, distributed generation sources and control devices.Due to the independence in operation, these networks can be separated from the main network and operated as islands.The main purpose of forming these networks is technical issues related to increasing the reliability and quality of electricity delivered to consumers.Therefore, from the point of view of the upstream networks, the MG is an element with dual characteristics, which is sometimes considered a burden and sometimes a source of production.

4With the significant growth of smart grids as well as the rapid improvement of communication platforms between production and consumption, MGs have moved towards smart-grid and the practical concept of electric smart MGs has been created.Using this model in case of adopting a comprehensive telecommunication infrastructure for energy management and protection is considered a suitable approach that can be applied to the current distribution networks in which the penetration of distributed generation will increase over time.Similar to the path of evolution of ordinary electric MGs to smart electric MG s and then the comprehensive management of smart electric MGs, Hub Energy has also evolved in the form of Hub Energy MGs, Smart Energy Hub MGs and a comprehensive network of Smart Energy Hub MGs [2].

5In the past, different energy systems were planned and managed independently.But today, the development of technologies such as the efficient multi-generation system leads to the realization of the benefits of integrated energy infrastructures such as electricity, natural gas and district heating (DH) networks, and as a result, the rapid movement towards multi-energy systems (MES).In such systems, energy carriers and different systems interact synergistically.However, paying attention to such a concept requires a suitable tool for the integrated management of system components.An energy Hub (EH), which can be defined as a place where the production, conversion, storage and consumption of different energy carriers takes place, is a promising option for the integrated management of multi-energy systems.

6According to reference [2], a centralized system of smart energy hub MGs is connected to a large central supplier.In this reference, the real-time pricing of the connected network is examined.Also, two types of smart hub MGs have been considered for connected centralized energy systems.Not using normal MGs, not checking distances and the possibility of connecting the introduced hub MGs in terms of distance, etc. can be considered as weak points of this research.

7In reference [3][4][5], a transmission network of energy carriers in the form of gas and electricity is introduced, which is intelligently provided through one or two central suppliers and with a telecommunication connection, MG.The smart hub is fed in different areas.The one-way energy path from the supplier to the consumer, the lack of attention to distributed generation sources and smart energy hubs, and as a result the lack of two-way energy exchange between smart energy hubs, are among the weak points of this research.

8According to reference [6], an advanced hybrid power generation cycle was evaluated to obtain sustainable energy with high power and efficiency.This combined cycle includes biomass gasification, Cascaded Humidified Advanced Turbine (CHAT) and steam turbine.The fuel consumed by the system is obtained from the gas produced in the process of conversion to biomass gas.

9Reference [7] focuses on minimizing operational cost and optimal power distribution associated with MGs coupled with natural gas networks using Particle Swarm Optimization (PSO).Introducing a natural gas turbine in an MG to overcome the disadvantages of renewable energy sources is a recent trend.This increases the load and congestion in the gas network.To avoid congestion and balance the load, it is necessary to coordinate with the power grid to plan for the optimal transmission of both interactive networks.

10Reference [8] presents a comparative case study with multiple biomass sources to analyze biological feedstock logistics plans with distributed warehouses and a primary warehouse located with the biological.An MILP model for simultaneous optimization of feedstock decisions and optimal preprocessing warehouse locations and sizes, using biomass sources from agricultural residues, energy, and municipal solid waste to meet carbohydrate specifications and feedstock demand for a biochemical conversion process is developed.

11Reference [9] proposes a multi-product multi-source framework for multi-carrier energy sources coupled with a biogas-solar-wind hybrid renewable system.In this framework, biogassolar-wind complements are fully exploited based on the thermodynamic effects of digestion for the synergistic interactions of electricity, gas and heating energy flows, and a coupling matrix is formulated to model production, conversion, storage and consumption.According to reference [10], a practical method for analyzing the economic distribution of a power system is described using the Lagrange coefficient method according to the Cohen-Tucker conditions, without considering the limitations and transmission losses.

12Reference [11] provides a new perspective and a complete mathematical tool to study the integrated energy system from the illegal market perspective.A Mathematical Program with an Equilibrium Constraint (MPEC) model is proposed to study the strategic behaviors of a profit-oriented energy pole in the electricity market and the heating market under the background of energy system integration.At the top level, the Energy Hub provides prices and quantities to an electricity distribution market and a heating market.At the lower level, two markets are settled and energy contracts are determined between the energy hub and two energy markets.The network limitations of physical systems are explicitly shown by an optimal power flow problem and an optimal heat flow problem.

13Reference [12] presents the coordinated energy management of energy hubs in different networks based on the cooperation of hubs in Day-ahead markets.The proposed model connects electricity, natural gas and district heating networks by considering electricity, and natural gas as hub input and electric energy and district heating as hub output.

14Reference [13] focuses on the optimal scheduling of regional energy systems with multiple energy supply modes and flexible loads.For the multi-energy system, the energy hub model including an energy storage system and integrated electric vehicle is developed.

15Multi-Carrier Hub Energy System (MCHES) meets different energy needs such as heating, cooling and energy demand by using different energy sources simultaneously.According to reference [14], a robust optimization approach (ROA) for robust multi-carrier energy hub system planning considering economic and environmental constraints in the presence of market price uncertainty and multi-demand response programs (DRP) is provided.

16In reference [15], there is a review of gas and electricity routes at the same time.This reference is a review of research considering the balance of these two energy carriers to become an energy hub and the works of this energy field have been reviewed.Reference [16] has also measured the effect of electrical routes on decision-making about gas routes and vice versa and has optimized these routes accordingly.In reference [17], the simultaneous effect of these two networks in macro-decision-making to become an energy hub has been considered.

17The expansion of renewable production sources that are distributed in the network creates many challenges for the electricity distribution networks.Recent advances in battery technologies have made battery energy storage systems (BESS) more economical than in the past, which is why these equipment are used.It is suitable for use in the network and at the distribution level.Also, the distributed BESS can act as a factor for more penetration of renewable energies in the distribution network [18].This reference obtains the most optimal mode for the placement and size of batteries.This situation is obtained according to the cost of batteries, operation, maintenance, etc.

18According to reference [19], each MG operator communicates with the distribution network operator (DNO) in the control layer to manage consumption and production.DNO plans production resources by considering the possible islanding of MGs in the distribution network.In reference [20], a sensitivity analysis is performed to investigate the impact of these technologies on unbalanced low-voltage residential networks located in Northern Ireland.The influence of different powers has been investigated and the results have been evaluated using different technical indicators.In reference [21], an optimal technique for the optimal location of the battery energy storage system (BESS) and the wind power penetration capacity for battery charging/discharging is proposed.

19Reference [22] deals with the optimal allocation of BESS in radial distribution systems to regulate bus voltage and reduce energy costs.According to reference [23], in recent years, the BESS has been considered a promising solution to reduce wind turbine generator frequencies.

20In references [24,25], the improvement of wind turbine performance to reduce the fluctuation of output power and also to increase the extracted energy in an MG has been investigated.Also, in references [26][27][28], the lifetime estimation of electrical network equipment has been reviewed.

21In distribution networks, the voltage stability index is an important issue and is considered a security objective function.Therefore, it is necessary to check this index by energy management in the distribution network.According to [29], this index is taken into account and dynamic distribution feeder reconfiguration (DDFR) is introduced as a suitable method for this management.This study has been considered by considering the voltage stability index, power loss and operation cost in a distribution network with the presence of PV, energy storage system and capacitors.

22In distribution networks, electricity prices and load patterns are constantly changing, and accordingly, many operational problems will affect electricity distribution networks.Therefore, to prevent these incidents, the problem will be considered in different time frames.In [30], a multi-objective optimization model is presented using the DDFR procedure in the distribution system and in multiple time intervals with the presence of energy storage systems and PV units.In [31], a cost-effective energy hub system is proposed using linear programming, considering transformer converters, combined heat and power (CHP), heat exchangers, and energy storage, including electric vehicle charging stations (EVCSs), and heat storage.

23Market exchanges for placement and appropriate size of DGs in an electricity distribution network have been investigated by proposing an appropriate algorithm in [32].Also, the energy management of the MG connected to the grid is described in [33].

24The short-term planning of the network to use renewable energy sources and increase their penetration has also been evaluated in [34].Electric energy management in the smart rural network has also been investigated according to [35].

25By reviewing the references and stating the goals of each one, the summary of the work done and its comparison with the innovations of this paper is shown in Table 1.According to this table, it is clear that the simultaneous examination of gas and electricity in the network, considering different types of load to analyze the results, and considering the energy hub management are among the innovations of this article that are less discussed in previous works.Also, the type of objective function in this work is one of its other specific innovations.

26In the basic state, MGs work as islands or not islands (connect to the grid).But the main point is the optimal communication of these MGs and their intelligent management and exploitation; in a way that can achieve the most optimal mode of using energy from a technical and economic point of view.Therefore, in this article, we will try to optimize the objective function with two issues electricity and gas.The purpose of optimization is to reduce network costs.In the non-optimized state, the costs of both energy sources will be much higher and we will not reach the optimal point in fuel consumption.In other words, we may go to gas power plants during the hours when we need electric energy and we can use relatively cheaper energy such as solar energy during the day, thus increasing the network costs.However, with optimal energy consumption and production side management, network costs can be optimized and this cost can be transferred to investment in other sectors.This review will consider the 24-hour optimal points for the MG from the perspective of cost.

27Based on this, the innovations of this paper include the simultaneous use of gas and electricity energy network along with distributed generation sources on the standard network, simulation with real and variable values of loads and energy prices on the model MG, optimal dispatch of energy in the standard MG, for 24-hour, in terms of cost minimization and a practical look at the problem of energy management in MGs.

28Based on this, in the second part of this article, the concept of an energy hub will be discussed.Then, in the third part, the modelling and expression of the relationships related to this research will be discussed, and based on that, the implementation procedure and related algorithms will be evaluated in detail.Next, in the fourth part of the article, the results obtained from this research will be explained.Based on the results of this discussion, the simultaneous minimization of the costs of electricity and gas MGs along with distributed generation sources and the production of each unit will be explained in detail.In the rest of the article, the obtained results will be discussed.At the end, the general conclusion will be expressed.

Energy hub concept

29The Energy Hub (EH) concept was developed by a research team at the High Voltage Power Systems Laboratory in Zurich in the framework of a project called Vision of Future Energy Networks (VOFEN).This project aims to create a picture of future energy systems in the long term (20 to 30 years) using the Greenfield approach [1].The main points of the VOFEN project can be summarized as follows: • Moving towards multi-energy systems to benefit from the synergistic benefits of different energy carriers.

30• Moving towards non-hierarchical structures.

31• Moving towards integrated and connected energy systems

32• In this paper, two concepts are presented to reach the main points mentioned.

33• Energy connectors: combined transport of different energy carriers over longer distances in single transmission devices.

34• Energy hub: conversion and storage of energy carriers in an integrated unit Therefore, the concept of EH was introduced as a result of the VOFEN project and as an interface between consumers, producers, storage devices and transmission devices in different ways directly or through conversion equipment or multiple carriers.

35Fig 1 shows the matrix model of the concept of EH to communicate different energy carriers in the input and output through the pairing matrix.Each element of the matrix represents the internal characteristics of EH, including the coefficients of connection and conversion of internal components of EH.

36In further studies, the energy hub is defined as follows [1]:

37• An EH is considered a unit in which several energy carriers can be converted, conditioned and stored.

38• A more precise definition of EH can be stated as follows:

39• EH is a unit that provides functions of input, output, conversion and storage of multiple energy carriers.

40Sometimes, next to the energy hub, the word hybrid is used, which refers to the interaction of different energy carriers in EH [1].

Implementation method

41In this section, the modeling of the article's proposed procedure and the implementation method will be explained in detail.

Micro-grid modeling

42In this part, the investigated MG models will be examined in detail along with the basic relationships of each part.

433.1.1.Price modeling.MGs participating in the market provide an hourly bid (P iM,t Bid ) for the next day of energy trading.The MG is in consumer-state when the offered offer is negative, otherwise it will be producer.Changes between production and demand will lead to a power imbalance between the actual power and the proposed power (ΔP t Imba ) as shown in the following equation:

44So that P t Act is the real power and it is obtained as the following equation:

45where ρ t Re-and ρ t Re+ provide the regulatory prices for the sale and purchase of electric energy in the RTB (Real-time balancing) market at time t, respectively.In addition, the DA market price is applied as a multiplier to calculate regulatory prices:

46where τ -and τ + are the relative differences between the sale and purchase price of electricity and the DA market price.The connection of electricity and gas networks along with electric and gas devices is shown in Fig 2 .According to this figure, it can be seen that two renewable sources, wind and solar, are located in the grid together with the distributed gas generation source as sources of electric power generation.The gas distribution source is also connected to the gas network, and based on that, it is connected to the country's gas network, and it is necessary to have gas lines next to the electric lines.Therefore, according to this figure, it can be concluded that considering these two networks at the same time is very important.

473.1.2.Gas system modeling.In this part, gas system models and related relationships will be discussed.

483.1.2.1.Line-pack modeling.In the pipelines of gas networks, compressed gas energy is called Line-pack (LP) and has a direct relationship with the average pressure in the pipelines.

49According to Boyle's law, gas in pipelines can be modeled as Eqs (A-1) and (A-2) in S1 Appendix, where Pr, z, v ij and Te are gas pressure (kPa), density (Kg/m 3 ), volume (m 3 ) and temperature (K), respectively.Also, the values of Pr 0 , z 0 , v ij0 and Te 0 are pressure, density, volume and temperature in normal gas conditions, respectively.Q Gas and Y Gas values are gas compressibility coefficient and gas constant, respectively.le ij and d ij are the length and inner diameter of pipe i-j.

50In dynamic conditions, the value of LP depends on the initial value of LP and the difference between gas consumed and supplied in the pipeline (ΔP ij,t

Gas

51). Gas consumers include nonelectric gas loads, compressor loads, gas storage, DG gas loads.The gas network and storage are also considered as gas suppliers.In steady state, the size of LP is calculated as Eqs (A-3) and (A-4) in S1 Appendix, where θ ij Initial and θ ij,t are the initial LP and the value of LP at time t, respectively.γ is the gas volume to energy converter coefficient in normal conditions (GJ/m 3 ).

52Δt is the time it takes to convert power into energy.P Gas,ijt De , P Gas,ijt Gen and P Gas,ijt Comp are demand, supplied gas and gas consumed by the compressor, respectively.

Gas and compressor flow modeling.

53Compressor and pipelines are two key elements of transmission system in gas networks.At steady state, the gas flow (f ij

Gas

54) and direction (Sgn ij ) are usually modeled by the Weymouth equation and depend on the gas pressure between the nodes.The flow equation of the pipeline between nodes i and j is presented as Eqs (A-5) and (A-6) in S1 Appendix, where P i (P j ) is the gas pressure at node i (j).Gr, χ ij and z are the gravity ratio, friction coefficient and air constant, respectively.

55For a compressor, the gas flow (f Gas,ij Comp ) and the amount of energy consumption are controlled by Eqs (A-7) and (A-8) in S1 Appendix, where P Gas,ijt Comp and HP Gas,ijt Comp are gas consumption and horsepower of a compressor, respectively.l 1, ij , l 2, ij and l 3, ij are the gas compressor coefficients between node i-j.Also, α 1, ij , α 2,ij and α 3,ij are coefficients related to compressor horsepower between i-j.

56In addition, the limit of the compressor ratio PR ijt Comp,up is as Eq (A-9) in S1 Appendix.

57Eqs (A-5), (A-7) and (A-8) in S1 Appendix are the first group of non-linear equations in this paper, which should be converted into a suitable linear form for linear programs of integers.For (A-5) and (A-7), we apply the linearization process used with two and three variables, which is based on the Taylor series.In addition, for equations with the form of quadratic functions such as (A-8), the piecewise linear approximation method is used to convert the nonconvexity of (A-8) into convexity.

583.1.2.3.Distributional robust chance constrained (DRCC) modeling.The DRCC method has been introduced as one of the powerful techniques for modeling probability-based constraint problems.Due to the fluctuating behavior of uncertain parameters, satisfying the constraints including them will also be possible.The DRCC method is used for problems with probabilistic constraints to not only deal with the uncertain nature of these problems, but also to maximize the MG profit with a certain probability according to the robustness of the system.The mathematical formulas of this method will be explained in this section.At first, it is assumed that the vector has random variables φ with the Eq (A-10) in S1 Appendix, where φ and σ 2 represent the mean and variance, respectively.

59Family D is all distributions with mean φ and variance σ 2 .We denote this family by D(φ,σ 2 ) and the DRCC method for each φ�(0,1) according to the mentioned information is defined as Eq (A-11) in S1 Appendix.

60This equation is equivalent to the adverb of the convex second order cone as Eq (A-12) in S1 Appendix where, φ is the probability of satisfying constraints with uncertain parameters.

Micro-grid optimum planning

61In this section, optimal planning for MG will be described.

Upper level (UL) problem.

62In this paper, the market structure of day-ahead (DA) and real-time balance (RTB) is used.In the DA and wholesale gas markets, MGs maximize their profits by optimizing the bidding strategy within the time frame.The optimal MG planning objective function in the high-level problem (first stage) is formulated as follows:

63where ρ t RT and ρ t Gas,retail are the retail prices of electricity and gas, and ρ t Gas is the price of gas in the wholesale gas market.T is the timing interval of DA.P Gas,ijt De and P Gas,ijt Gen are the amount of gas demand and production.In the objective function, the first term is the income (cost) of selling (buying) electric energy from (by) the MG to (from) the distribution network.The second term is the income from the sale of electrical energy to consumers.The next four terms are the imbalance cost, IL, BESS, and DG units, respectively.The last two periods are the income from selling gas to gas consumers and the cost of buying gas from the wholesale gas market.

64According to what was said, when ΔP t Imba <0, the MG needs to purchase energy shortages in the RTB market, and the sign of Cost t Imba in (3) will be negative, which is the imbalance cost for MGs to apply the mentioned cost in the objective function.The sign of the third part (5) must be positive, which becomes a negative sign in the presence of Cost t Imba .After solving the problem, the value of the mentioned variables is determined and all of them are considered to minimize the power deviation cost in the second stage problem.In the high-level DA scheduling problem, the model is considered as a here-and-now decision process.

65The To obtain the uncertainty parameters, the DRCC method should be applied to the problem formulations.At first, the total profit of the MG F in the DA scheduling problem is given as Eq (A-18) in S1 Appendix.

66To use the DRCC method, the auxiliary variable Z to maximize the profit of the MG is defined as Eq (A-19) in S1 Appendix, where φ is the level of confidence determined by the decision maker based on the strength of the system.Therefore, the main objective function after applying DRCC is as Eq (A-20) in S1 Appendix, where σρ DA t and σρ Gas t are the standard deviations of DA market and gas prices, respectively.

67Obtaining a certain amount of profit for MGs is guaranteed by the DRCC method; because in the worst case, uncertain parameters in the system are obtained by considering specific values for the mean and variance of each uncertain parameter and a certain value from it.The confidence level determined by the decision maker.If the mean and variance values for uncertain parameters change based on the energy market and geographic conditions, or the level of confidence changes by the decision maker, it is obvious that the benefit will be for MGs.In new conditions, the system is guaranteed due to considering the worst cases of all uncertain parameters.The complete constraints related to the high-level problem are also stated as follows.

683.2.1.1.Electric energy balance limitation.The limit of electrical energy balance is expressed as Eq (A-21) in S1 Appendix.

Wind power limitation. The limit of wind power is expressed as Eqs (A-22) and (A-23) in S1 Appendix, where, Q iM,t

69Wind is the output reactive power of the wind turbine at bus i and at time t.After applying the DRCC method, the new wind power limit will be as Eq (A-24) in S1 Appendix, where P iM,t

70Wind,UP , ω and σP Wind,UP iM,t are the upper limit, confidence level and standard deviation of wind power, respectively.

713.2.1.3.Solar cell power limitation.The limitation of solar cell power is expressed as Eq (A-25) in S1 Appendix, where SOL, S PV , and η PV are solar radiation, PV panel size, and PV efficiency, respectively.

72After applying the DRCC method, the limitation of the new PV panel is expressed as Eq (A-26) in S1 Appendix, where ɘ and σ SOLt are the confidence level of PV and the standard deviation of SOL t at time t, respectively.The limitation of the energy storage system is stated as Eqs (A-38)-(A-42) in S1 Appendix, where, η CIf is the loss coefficient related to the charging or discharging state of the BESS.In this research, the value of the loss coefficient is assumed to be constant.P iM,t

73Chr,BESS and P iM,t Dis,BESS are the maximum charge and discharge power of BESS. a and b are auxiliary variables that are used to remove the absolute function.Eq (A-38) in S1 Appendix shows the limit of BESS energy balance.Eqs (A-39) to (A-40) in S1 Appendix show the state of load restrictions and (A-41) shows the discharge or charging capacity.Finally, the final and initial energy stored in the BESS are given in (A-42).

IL flow limitation.

74To ensure the stability of the power grid in emergency situations (for example, when the sum of electricity produced and energy received from the main grid is less than energy consumption), the possibility of load reduction is also considered for energy balance in the grid.The presence of random producers whose restrictions are as Eqs (A-43)-(A-44) in S1 Appendix.Eqs (A-43) and (A-44) in S1 Appendix state that the value of IL must be kept within the permissible range.

753.2.1.7.Electric energy network limitation.The eqations of AC current in each bus and at time t are formulated as Eqs (A-45)-(A-51) in S1 Appendix, where P it Injecte (V it ,θ it ) and Q it Injecte (V it ,θ it ) correspond to active and reactive power injection in bus i at time t, respectively.PitDe and QitDe show active and reactive power demand.Eqs (A-49) to (A-51) in S1 Appendix express the allowed changes of mixed power, voltage magnitude and voltage angel, respectively.

763.2.1.8.Gas network limitation.The limitation of the gas network is expressed as Eqs (A-52)-(A-55) in S1 Appendix, where P Gas,ijt De and P Gas,ijt De,Heat are the total energy demand and heating energy load at time t, respectively.Eqs (A-52) and (A-53) in S1 Appendix express gas node balance and demand limits, respectively.Eqs (A-54) and (A-55) in S1 Appendix express LP changes, initial and final energy of LP limits, respectively.3.2.1.9.Connection exchanges limitation.The limit of connection exchanges is stated as Eq (A-56) in S1 Appendix, where, the lower and upper lines are the minimum and maximum amount of energy exchange in the energy market, respectively.

Lower level (LL) problem.

77In the RTB market, the power balance can be created by optimal planning in the timing horizon.It is assumed that this market is very high.Every 5 minutes after determining the value of binary variables by solving the proposed optimal model in the high-level problem, all MGs should adjust their controllable devices such as DG unit to compensate for power deviations in the real-time balancing market.In the lower level problem, the relationship is expressed as follows:

78where Cost t Imba is the cost of disequilibrium in the lower level problem.The complete constraints of Eq (6) include Eqs (A-21) to (A-30) in S1 Appendix, Eqs (A-38) to (A-41) in S1 Appendix and Eqs (A-43) to (A-55) in S1 Appendix.

79Since the main goal in the second stage is to minimize the imbalance costs by minimizing the amount of power deviations, the value of P iM,t Bid (which is determined in the problem of the first stage) in Eq (A-57) in S1 Appendix is used for this purpose.Therefore, the value of P t RT is updated by adjusting the DERs schedules in (A-58) considering the value of P iM,t Bid with the aim of minimizing the power deviations without changing the state of the DG units that were previously determined in the first.Phase problem by minimizing the amount of power deviations, the amount of unbalance costs is also minimized according to (A-59).

Micro-grid energy price

80The average of energy price (EP) is shown in Fig 3 .This value is adopted in the year according to the data obtained from 2020.As can be seen, the value of this index is changing during one day, and during peak hours, the EP consumption is higher than during off-peak hours.These values have an impact on the cost of the MG.In other words, if the load of the MG is high during peak hours, the cost of the MG will increase.Now, by achieving the production capacity of each power plant according to the above procedure and also considering the EP according to the above figure, the production cost of each power plant during one day can be obtained according to the following relationship:

81where Price j is the cost of the j-th power plant, P i j is the power value of the same power plant in the i-th hour, and EP i is the energy price in the i-th hour.

Simulation results

82The simulation related to this research is coded in Games software and as a mixed integer non-linear programming (MINLP).The reason for using this software is its ability to solve non-linear problems and optimization.The efficiency of gas turbines and fuel cells (FC) depends on their working point, and considering the exact model of these sources and the relationships related to the calculation of their fuel consumption is non-linear.On the other hand, a binary variable has been used to show the charging and discharging state of the storage tank and the on-and-off state of the gas turbines.Therefore, our problem is an MILP.There are several solvers in Games to solve MILP problems:

83• DICOPT solver has a very good speed.

84• The COUENNE solver has been used to solve the problem, which has a good performance, but the speed of its solution is a little slow.

85According to what was said, to electrify the load in this article, it is necessary to feed this power by the following power plants:

86• Production power of micro-turbine 1 (MT1)

87• Production power of micro-turbine 2 (MT2)

88• Production power of micro-turbine 3 (MT3)

89• Production power of solar cell • Production power of wind turbine • Production power of fuel cell

• Power of charging and discharging energy storage

90The simulation performed in this paper was tested on a 33-bus IEEE radial distribution system and its information can be accessed in [32].The general schematic of this micro-grid is according to Fig (2).Also, the load profile of this network has been used based on [33].

91The safety pressure and diameter for gas pipelines are 140 kPa and 660 mm, respectively.Information related to wind turbine sources as well as distributed generation units is given in [34].In addition, the price of natural gas can be seen in [35].Now, the results of this simulation will be examined in Gomes software, including the amount of load power and each of the above production powers.

Power consumer values

92The amount of consumer power or consumption demand, in the network under investigation, during 24 hours a day, is specified in this section.This consumer data can be checked in the following two scenarios:

93• Optimized demand • Un-optimized demand These load data during the period of 24 hours and in the two stated scenarios will be in the form of Fig 4. According to this figure, it can be seen that the non-optimized load has more load power than the optimized load power.Also, the load capacity increases after 16:00 and the amount of load in state un-optimized demand shows less fluctuation in other words, consumption optimization has not been done.In the morning hours, the amount of load power is high.

Power producer values

94As mentioned, the data values of the producers include 7 production sources of MT1, MT2, MT3, solar cell, wind turbine, fuel cell and storage energy source.Based on this, in this section and in the following, the details of the production power of each of these sources will be discussed after optimization in GAMS software.

954.2.1.MT1 power producer values.The production power value of MT1 after optimization is specified in this section in the form of a correct mixed non-linear programming in GAMS software and during 24 hours.This production data will be in the Fig 5 .According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night.The reason for the high fluctuation in this power generation is the peak load during the day and the related optimization issue.

964.2.2.MT2 power producer values.The production power value of MT2 after optimization is specified in this section in the form of a correct mixed nonlinear programming in GAMS software and during 24 hours.This production data will be in the Fig 6 .According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night.

MT3 power producer values.

97The production power value of MT3 after optimization is specified in this section in the form of a MINLP in GAMS software and during 24 hours a day.This production data will be in the Fig 7.According to this figure, it can be seen that this production source produces more power in the morning until the end of the day and turns off at night.According to Figs 5-7, it can be seen that three situations MT1-MT3 have similar behavior and all three have little production in the early hours of the day and their production increases in the later hours.

Photovoltaic power producer values.

98The amount of solar cell production power after optimization is specified in this section in the form of a correct mixed nonlinear programming in the Gomes software and during 24 hours a day.This production data will be in the power during the hours of the day when the sun starts to shine, and when the sun's radiation decreases, its production power becomes zero.4.2.5.Wind power producer values.The amount of wind turbine production power after optimization is specified in this section in the form of a correct MINLP in Gomes software and during 24 hours a day.This production data will be in the Fig 9 .According to this figure, it can be seen that in some hours of the day and night when the wind speed increases, the amount of power produced from this source has also increased, and this amount of power may be completely different on another day.In other words, the power produced by the wind turbine source depends on the wind speed and does not depend on the hours of the day.

994.2.6.Fuel cell power producer values.The output power of the fuel cell after optimization is specified in this section in the form of a MINLP in GAMS software and during 24 hours a day.This production data will be in the of the energy storage system.According to this figure, it can be seen that the power charged or discharged from this energy source depends on the difference between the power produced from other sources and the power consumed by the load.In other words, if the amount of power generation is more than the load, the energy storage system will be charged, and on the contrary, if the amount of load is more than the power production, the energy storage system will be discharged.Also, the energy data of the energy storage will be in the Fig 12.

Discussion

100In this section, the results obtained in the previous sections will be discussed.Based on this, at first, we will obtain the total production power from the sources of MT1, MT2, MT3, solar energy, wind energy, and fuel cells.Then, the difference between this value with the charge and discharge power values of the energy storage system is obtained to see whether this energy storage source correctly detects charging and discharging or not.

101For this purpose, fig 13 shows the total production power from the 6 sources mentioned above during a period of 24 hours a day.Fig 14 also shows the difference in the amount of power produced by six power generation and the load in the non-optimized scenario.According to this figure, it can be seen that this amount of power expresses the amount of charging and discharging of the energy storage source.In other words, this difference is the lack or excess of power in the network, which needs to be charged and discharged by the energy storage source.According to this figure, it can be seen that this figure is similar to Figs ( 5-9) with an acceptable approximation.The relative difference between these two forms is caused by the inertia of the energy storage source that will change its state.Now, according to fig 14, it can be seen that there is no significant difference between the power produced by the six production sources and the load power, and this optimization procedure can be fully used.

102Also, according to the reference [2] that the data was extracted according to this reference, it can be seen that the network costs will be significantly reduced with the optimization done in this article.In other words, if the appropriate wind and solar production power was not used optimally in this article, as in reference [2], it was necessary to use the energy of microturbines to produce electric power, which is extremely expensive.It increased the network.

103The amount of produce price of a power plant in the MG is obtained according to Table 2.As can be seen:

104• The economic efficiency of micro-turbines is higher than other power plants due to continuous power generation.• The economic efficiency of the solar cell is relatively suitable because it produces power during peak load times (note that the solar cell produces power only in limited hours of the day and yet it has a significant amount of economic efficiency).

105• The amount of power produced by the battery storage is low due to being discharged every moment, although it plays a significant role in smoothing the production power of the network.

Conclusion

106In this article, an attempt was made to code the simulation in the form of an MILP using GAMS software.Based on this and according to the output of this software, the amount of power difference between generators and load using GAMS problem optimization, the charge and discharge values of energy storage have been expressed.In other words, this difference is the lack or excess of power in the network, which needs to be charged and discharged by the energy storage source.The results of this optimization were verified according to the charging and discharging output of the energy storage device.The relative difference was caused by the inertia of the energy storage source.By precisely defining the optimization problem and extracting the objective function, the amount of production of each electrical energy generating unit with two issues of electricity and gas during 24 hours was accurately obtained.According to the results of this article, it is possible to accurately determine the amount of production of each resource to reach the optimal cost amount during the 24 hours.With this analysis, network costs will be significantly reduced by combining gas and electricity.In other words, it is possible to go to gas power plants during the hours when electricity is needed and use relatively cheaper energy such as solar energy during the day, thus increasing network costs.With optimal energy consumption and management of the production side, network costs can be optimized and this cost can be transferred to investment in other sectors.The method proposed in this article is based on mathematics and due to the use of software based on optimization, the accuracy of its results is high.

Fig 1 .

107Fig 1.Power conversion modeling through an energy hub.https://doi.org/10.1371/journal.pone.0309999.g001

Fig 2 .

108Fig 2. Schematic of MGs in coupled gas and electricity networks.https://doi.org/10.1371/journal.pone.0309999.g002

Fig 3 .

109Fig 3. Energy price during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g003

Fig 4 .

110Fig 4. Load data during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g004

Fig 8 .

111According to this figure, it can be seen that this production source starts producing

Fig 5 .Fig 6 .Fig 7 .

112Fig 5. MT1 production power data during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g005

Fig 10 . 4 . 2 . 7 .

113According to this figure, it can be seen that the power generated from this source of power generation is turned off at night and does not generate power.Energy storage power producer values.The amount of power and energy charged and discharged of the energy storage after optimization is specified in this section in the form of a correct MINLP in GAMS software 24 hours a day.The data of the charged and discharged power of the energy storage will be as shown in fig 11.Positive values in this figure indicate the discharge status of the energy storage system and negative values indicate the charging status

Fig 8 .

114Fig 8. PV production power data during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g008

Fig 9 .

115Fig 9. Wind turbine production power data during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g009

Fig 10 .Fig 11 .Fig 12 .

116Fig 10.Fuel cell production power data during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g010

Fig 13 .

117Fig 13.Total production capacity during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g013

Fig 14 .

118Fig 14.All power production and load power differences in non-optimized scenario during 24 hours.https://doi.org/10.1371/journal.pone.0309999.g014

Table 1 . Compare the proposed method and previous methods.

119-EV: Electrical Vehicle-ES: Energy Storage-DG: Distributed Generation-EH: Energy Hub. https://doi.org/10.1371/journal.pone.0309999.t001

1203.2.1.4.Dispersed production unit limitation.The limitation of distributed production unit is stated as Eqs (A-27)-(A-37) in S1 Appendix, where PiM, P iM,t DG and P iM,t DG show, respectively, the lower and upper limit of DG power in iM MG at time t.P Gas,iM,t De,DG is the gas demand of the DG unit.HRa Gas is the gas heating rate (MW/GJ).Ra iM DG,Up and Ra iM DG,Down are the up and down ramps of DG in iM MG.MUT iM and MDT iM are minimum upper and lower limits of DG. e is an index to model the minimum upper and lower bounds running from 1 to Max{MUT iM ,MUT iM }. 3.2.1.5.BESS energy storage system limitation.

Table 2 . Price of power plant.

121https://doi.org/10.1371/journal.pone.0309999.t002

참고문헌 34건

  1. Short‐term operational planning framework for virtual power plants with high renewable penetrations IET Renewable Power Generation · Institution of Engineering and Technology · 2016 10.1049/iet-rpg.2015.0358
  2. Wind turbine power output smoothing in microgrid using ultra-capacitor with continuous wind speed forecasting and online supervisory control Journal of Renewable and Sustainable Energy · American Institute of Physics · 2016 10.1063/1.4950958
  3. Balancing collective and individual interests in transactive energy management of interconnected micro-grid clusters Energy · Elsevier BV · 2016 10.1016/j.energy.2016.05.052
  4. Energy flow modeling and optimal operation analysis of the micro energy grid based on energy hub Energy Conversion and Management · Elsevier BV · 2016 10.1016/j.enconman.2016.12.011
  5. Energy hub: From a model to a concept – A review Renewable and Sustainable Energy Reviews · Elsevier BV · 2017 10.1016/j.rser.2017.07.030
  6. Dynamic Economic Dispatch of Microgrid with Biomass Power Generation Proceedings of the 2018 7th International Conference on Energy and Environmental Protection (ICEEP 2018) · 2017 10.2991/iceep-17.2017.113
  7. Optimal Configuration Planning of Multi-Energy Systems Considering Distributed Renewable Energy IEEE Transactions on Smart Grid · Institute of Electrical and Electronics Engineers · 2017 10.1109/tsg.2017.2767860
  8. Transactive energy integration in future smart rural network electrification Journal of Cleaner Production · Elsevier BV · 2018 10.1016/j.jclepro.2018.04.043
  9. Participation of an Energy Hub in Electricity and Heat Distribution Markets: An MPEC Approach IEEE Transactions on Smart Grid · Institute of Electrical and Electronics Engineers · 2018 10.1109/tsg.2018.2833279
  10. Optimal Scheduling of Biogas–Solar–Wind Renewable Portfolio for Multicarrier Energy Supplies IEEE Transactions on Power Systems · Institute of Electrical and Electronics Engineers · 2018 10.1109/tpwrs.2018.2833496
  11. Exchange Market Algorithm for Multiple DG Placement and Sizing in a Radial Distribution System Journal of Energy Management and Technology · 2018 10.22109/jemt.2018.116625.1059
  12. Robust scheduling of thermal, cooling and electrical hub energy system under market price uncertainty Applied Thermal Engineering · Elsevier BV · 2018 10.1016/j.applthermaleng.2018.12.108
  13. Application of Particle Swarm Optimization to a Scheduling Strategy for Microgrids Coupled with Natural Gas Networks Energies · Multidisciplinary Digital Publishing Institute · 2018 10.3390/en11123499
  14. Distributed biomass supply chain cost optimization to evaluate multiple feedstocks for a biorefinery Applied Energy · Elsevier BV · 2019 10.1016/j.apenergy.2019.113660
  15. Wind turbine and ultra-capacitor harvested energy increasing in microgrid using wind speed forecasting Engineering Science and Technology an International Journal · Elsevier BV · 2019 10.1016/j.jestch.2019.08.006
  16. Grid-connected energy hubs in the coordinated multi-energy management based on day-ahead market framework Energy · Elsevier BV · 2019 10.1016/j.energy.2019.116055
  17. Hierarchical Optimal Allocation of Battery Energy Storage Systems for Multiple Services in Distribution Systems IEEE Transactions on Sustainable Energy · Institute of Electrical and Electronics Engineers · 2019 10.1109/tste.2019.2946371
  18. Emission Trading Based Optimal Scheduling Strategy of Energy Hub with Energy Storage and Integrated Electric Vehicles Journal of Modern Power Systems and Clean Energy · Springer Nature · 2020 10.35833/mpce.2019.000144
  19. Energy Modeling and Techno-Economic Analysis of a Biomass Gasification-CHAT-ST Power Cycle for Sustainable Approaches in Modern Electricity Grids Journal of Renewable Energy and Environment · 2020 10.30501/jree.2020.106780
  20. Multi‐objective energy management approach in distribution grid integrated with energy storage units considering the demand response program International Journal of Energy Research · Wiley · 2020 10.1002/er.5709
  21. Optimal participation of demand response aggregators in reconfigurable distribution system considering photovoltaic and storage units Journal of Ambient Intelligence and Humanized Computing · Springer Science+Business Media · 2020 10.1007/s12652-020-02322-2
  22. Simulation Scenario Analysis of Operational Day to Day Storage System of Biomass Supply Chain for a Power Plant Case Study Based on Logistic Cost and Transportation Emissions 2021 International Conference on Advances in Electrical, Computing, Communication and Sustainable Technologies (ICAECT) · 2021 10.1109/icaect49130.2021.9392411
  23. Decentralized energy management for unbalanced networked microgrids with uncertainty IET Generation Transmission & Distribution · Institution of Engineering and Technology · 2021 10.1049/gtd2.12145
  24. Performance analysis of unbalanced radial feeder for integrating energy storage system with wind generator using inherited competitive swarm optimization algorithm Journal of Energy Storage · Elsevier BV · 2021 10.1016/j.est.2021.102574
  25. Impact of the deployment of solar photovoltaic and electrical vehicle on the low voltage unbalanced networks and the role of battery energy storage systems Journal of Energy Storage · Elsevier BV · 2021 10.1016/j.est.2021.102975
  26. Optimal Planning of Distributed Battery Energy Storage Systems in Unbalanced Distribution Networks IEEE Systems Journal · Institute of Electrical and Electronics Engineers · 2021 10.1109/jsyst.2021.3099439
  27. An optimization technique for battery energy storage with wind turbine generator integration in unbalanced radial distribution network Journal of Energy Storage · Elsevier BV · 2021 10.1016/j.est.2021.103160
  28. Effect of power-to-gas technology in energy hub optimal operation and gas network congestion reduction Energy · Elsevier BV · 2021 10.1016/j.energy.2021.122835
  29. A Simplified Model of Quadratic Cost Function for Thermal Generators Annals of DAAAM for ... & proceedings of the ... International DAAAM Symposium · DAAAM International Vienna · 2012 10.2507/23rd.daaam.proceedings.006
  30. Prioritizing CBs Maintenance and Identifying Mandatory Maintenance at Higher Priorities International Transactions on Electrical Energy Systems · Wiley · 2022 10.1155/2022/5008166
  31. A review on energy hubs: Models, methods, classification, applications, and future trends Alexandria Engineering Journal · Elsevier BV · 2023 10.1016/j.aej.2023.01.021
  32. A Novel Pipeline Age Evaluation: Considering Overall Condition Index and Neural Network Based on Measured Data Machine Learning and Knowledge Extraction · Multidisciplinary Digital Publishing Institute · 2023 10.3390/make5010016
  33. Comprehensive condition assessment of circuit breakers in a power network for maintenance scheduling IET Generation Transmission & Distribution · Institution of Engineering and Technology · 2023 10.1049/gtd2.12908
  34. Energy Hub Management considering Demand Response, Distributed Generation, and Electric Vehicle Charging Station International Transactions on Electrical Energy Systems · Wiley · 2023 10.1155/2023/9042957