# Eco-Environmental Uncertain Management of Various Energy Hubs within a Microgrid Concentrated on Demand Response, Intelligent Parking Lots, and Power-to-Gas Unit Effects

Authors: Majid Abbasi Gharai; Rahmat-Allah Hooshmand; Seyyed Mostafa Nosratabadi
Journal: International Journal of Energy Research
 (2023)

---

## Abstract

Nowadays, consumption of different energy carriers is increasing due to the division of community activities in various sectors such as residential, commercial, and industrial. The energy hub concept is used to meet the demands of different energy carriers in these sections. In this paper, a new method for energy management of a microgrid is presented in an intelligent network based on three types of commercial, residential, and industrial energy hubs. In the energy hubs, a wide range of components, including renewable and nonrenewable generation units, converters, storage devices, intelligent parking lots consisting of electric vehicles, P2G units, and cogeneration units, are used to supply electrical, heating, cooling, and natural gas energies. Some parameters like renewable generations, energy demands, and arriving and departure time of electric vehicles are considered to be uncertain, and a relevant method is applied to provide a near-realistic profile for them. In addition, a demand response paradigm has also been proposed for three types of electrical, heating, and cooling demands at the hub output side. Therefore, in this method, a mixed integer linear programming model is proposed based on benefit and reduction of emission caused by the activity of gas-burning units for short-term planning and obtaining an optimal solution for generation and sending loads in a distribution network containing energy hubs. To evaluate the performance of the proposed modeling and structure, the presented approach is applied on a modified 33-bus IEEE test network. According to the results of the energy management model, it is possible to significantly increase benefits and also obtain a smoother consumption pattern in consumption with financial incentives.


---

## Body

## 1. Introduction

### 1.1. General Motivation

One of the most important issues in smart grids management is finding a balance between energy generation and demand. One of the effective solutions to this equilibrium will appear in the concept of “energy hub” (EH). EH refers to a set where the outputs of various energy carriers are connected to their consumers with careful planning. In such sets, the diversity in energy carrier generation required by different generation resources, along with planning on the demand side, is an important and effective factor to balance the energy supply and consumption demand [1]. In the energy generation sector, EH seeks to create flexibility in energy supply by using various resources that generate energy carriers for different energy consumptions [2]. The most important energy carriers used in EHs are electricity, heating, and cooling, which must be taken into consideration [3]. The next challenge the EHs face is the production of carbon dioxide in the use of gas-fired units. In this regard, electricity to gas conversion technology (P2G) is considered as a new method to improve the performance of energy systems [4]. Directly, when integrating a P2G facility into a CCHP system, the synthesized natural gas can be reused by the CCHP or sold to the upstream natural gas network for additional revenue. Therefore, it is necessary to conduct a comprehensive study while taking the challenges mentioned into account to better meet demand and increase operating benefits.


### 1.2. Literature Review

In recent years, the deterministic planning approach has been widely used to model various problems for energy management in EHs [5–7]. In addition, EH short-term planning methods with different objectives have been considered. Accordingly, EH planning for the one-day time horizon, including demand response program, different types of energy storages, and renewable energy sources, is focused on [8]. In [9], a multipurpose optimization problem is formulated to maximize social welfare and minimize CO2 emissions. In [10], a bilevel optimization framework has been developed for optimal interaction of EHs and distributed networks in which the total cost of network operations is minimized due to network constraints on the upper-level problem. The proposed model is a nonlinear problem in which the Karush-Kuhn-Tucker optimization conditions are also considered. In [11], energy planning is investigated for an integrated three-level energy system using the Stackelberg Hierarchical Game method. This system is composed of one electricity utility company and one natural gas utility company on the upper level, as well as multiple same-structured smart EHs that can generate electricity and heat simultaneously on the middle level and multiple users on the lower level.Refs. [12, 13] propose an optimal load distribution model for the EH community, which aims to reduce the total cost of the EH community, including operating costs and the cost of CO2 emissions of the system. In this EH, combined heat and power (CHP) unit, boiler, heat storage unit, PV array, wind turbine, and electric vehicles (EVs) are considered. In [14], a cost-based mixed-integer linear programming model is proposed for the short term planning and to obtain the optimum solution for the production and load dispatch in a distribution network containing some EHs. Ref. [15] provides coordinated energy management of EHs across different networks based on the cooperation of hubs in the future markets. The proposed model connects electricity, natural gas, and district heating networks. In addition, a bilevel optimization problem is proposed in [16] for optimal planning of an active distribution system. With this system, the grid sells its surplus electricity to the growing electricity market. A multipurpose optimization problem is formulated in [17] to allocate power supply in smart residential EH and to provide scheduling plans for energy-using equipment alongside conventionally classified devices. An optimal operation model is proposed in [18] to manage multiple EHs with electrical and thermal energy demand, which aims to reduce the total cost of EHs. A robust optimization approach is then proposed to deal with the uncertainty of distributed renewable energy sources and electricity prices. At the same time, the electrical and thermal demand response (DR) programs are considered in the proposed model, and the results of optimal distribution are discussed under independent and accumulation scenarios with and without DR programs. In [19], an interval-stochastic hybrid framework for EH robust programming is proposed, in which thermal and electrical DR applications are provided for flexible energy management to reduce operating costs. In [20], multi-EH system planning is presented in the presence of renewable energy sources with a multiobjective model to reduce the carbon emissions and operation cost.Ref. [21] has discussed the optimization problem in order to reduce the cost of an EH by considering the PV as well as IPL. Also in [22], in order to minimize the impact of unexpected events on the system, a new energy management tool for isolated microgrids that is resistant to failure is presented. In this paper, a stochastic-IGDT formulation is developed, by which typical uncertainties are modeled through scenarios. Ref. [23] has developed an energy management framework that employed flexible demand, storage devices, and electric vehicles. In this reference, a stochastic interval model is proposed to deal with uncertainties of demand, renewable energy generation, vehicle behavior, and energy pricing.In addition, an optimal pricing strategy for an EH is modeled on [24], where the proposed model enabling EH takes advantage of the current and real-time markets. The optimization model is presented in this strategy to manage several market uncertainties, including day-to-day market prices, real-time market prices, and wind generation. Ref. [25] presents a robust optimization approach that is proposed for the planning of multicarrier hub energy systems taking into account the economic and environmental constraints in the presence of multi-DR programs. A model is presented in [26] for EH programming that meets electrical, thermal, and cooling needs and manages controllable on-and-off appliances. Concerns about energy security and environmental protection have raised the need to produce, convert, and use energy in a more efficient, clean, and diverse way. Based on this, a model is presented in [27] for EH design, which combines distributed energy/heating/cooling power supply, renewable energy, and energy storage. These EHs include heating, cooling, power systems, natural gas, and electricity generation, where the photovoltaic units are the primary energy resources. Also, a paradigm and operating model has been proposed for multiple regional energy producers whose energy demand is met by interconnected EHs. The EH residential model which is powered by electricity, natural gas, and solar radiation at its input port meets the electrical, thermal, and cooling needs at the output port [28].Recently, the use of distributed generation sources and EVs has increased to reduce air emission and greenhouse gas emissions. Also, intelligent parking lot (IPL) has increased in response to the increasing number of EVs. Therefore, in [29], optimal energy management is proposed for an IPL that includes renewable energy sources and local distribution generators.


### 1.3. Paper Contributions

Based on the literature review presented, this paper proposes a new method to manage and plan an active distribution network as microgrid in the presence of multiple EHs by considering different components including different storages and responsive loads. In order to clarify the differences between this paper and recent papers in the field of EH planning, Table1 is provided. Therefore, the contributions of this paper are introduced as follows:
(i)
Proposing a microgrid including different types of EHs containing various generation units, converters, and storage units to supply electricity, heating, cooling, and natural gas demands(ii)
Providing optimal performance between EHs with the aim of microgrid benefits maximization(iii)
Providing optimal performance of EVs to meet the electric demand within IPLs(iv)
Considering the uncertainty on the consumed loads types as well as the amount of primary energy of EVs(v)
Using the P2G system in gas-fired units to reduce the emission(vi)
Executing DR program on three demands of electricity, thermal, and cooling energy in the proposed modelingTable 1
Comparison of recent models with the proposed model in this paper.
Ref.Objective functionsNetworkStorage systemIPLP2G unitDRUncertainRenewable resourceESSTSSCSSGSSElectricityThermalCoolingLoadIPLRenewable resource[3]Cost✓✓✓✗✗✗✗✗✗✗✓✗✓✓[4]Cost✓✓✗✗✓✗✓✗✗✗✗✗✗✓[5]Cost✓✓✓✗✗✗✗✓✓✗✓✗✓✓[8]Cost✗✓✓✓✗✗✗✓✗✗✓✗✓✓[9]Cost✓✓✓✗✓✗✓✗✗✗✗✗✓✓[10]Cost✓✗✗✗✗✗✗✗✗✗✓✗✓✓[11]Benefit✓✗✗✗✗✗✗✓✓✗✓✗✗✗[13]Cost✗✗✓✗✗✓✗✓✓✗✓✓✓✓[15]Benefit✓✗✓✗✗✓✗✗✗✗✓✗✓✓[16]Cost✓✓✓✓✗✓✗✓✓✓✓✗✓✓[18]Cost✓✓✗✗✗✗✗✗✗✗✓✗✓✓[19]Cost✗✓✓✗✗✗✗✓✓✗✓✗✓✓[20]Cost✗✓✓✓✗✗✗✓✓✓✓✗✓✓[25]Cost✗✓✓✓✗✗✗✓✗✗✓✗✓✓[26]Cost✗✓✓✓✗✓✗✗✗✗✗✗✗✗[30]Cost✗✓✗✗✗✗✗✓✗✗✓✗✓✓[31]Benefit✗✓✓✗✗✗✗✓✓✗✓✗✓✓[32]Cost✗✓✓✗✗✗✗✓✓✓✗✗✓✓[33]Cost✗✓✓✗✓✗✓✓✓✓✓✗✓✓[34]Cost✗✓✓✓✗✗✗✓✓✓✓✗✓✓[35]Cost✗✓✓✗✗✗✗✓✓✗✓✗✓✓This paperBenefit✓✓✓✓✓✓✓✓✓✓✓✓✓✓


## 1.1. General Motivation

One of the most important issues in smart grids management is finding a balance between energy generation and demand. One of the effective solutions to this equilibrium will appear in the concept of “energy hub” (EH). EH refers to a set where the outputs of various energy carriers are connected to their consumers with careful planning. In such sets, the diversity in energy carrier generation required by different generation resources, along with planning on the demand side, is an important and effective factor to balance the energy supply and consumption demand [1]. In the energy generation sector, EH seeks to create flexibility in energy supply by using various resources that generate energy carriers for different energy consumptions [2]. The most important energy carriers used in EHs are electricity, heating, and cooling, which must be taken into consideration [3]. The next challenge the EHs face is the production of carbon dioxide in the use of gas-fired units. In this regard, electricity to gas conversion technology (P2G) is considered as a new method to improve the performance of energy systems [4]. Directly, when integrating a P2G facility into a CCHP system, the synthesized natural gas can be reused by the CCHP or sold to the upstream natural gas network for additional revenue. Therefore, it is necessary to conduct a comprehensive study while taking the challenges mentioned into account to better meet demand and increase operating benefits.


## 1.2. Literature Review

In recent years, the deterministic planning approach has been widely used to model various problems for energy management in EHs [5–7]. In addition, EH short-term planning methods with different objectives have been considered. Accordingly, EH planning for the one-day time horizon, including demand response program, different types of energy storages, and renewable energy sources, is focused on [8]. In [9], a multipurpose optimization problem is formulated to maximize social welfare and minimize CO2 emissions. In [10], a bilevel optimization framework has been developed for optimal interaction of EHs and distributed networks in which the total cost of network operations is minimized due to network constraints on the upper-level problem. The proposed model is a nonlinear problem in which the Karush-Kuhn-Tucker optimization conditions are also considered. In [11], energy planning is investigated for an integrated three-level energy system using the Stackelberg Hierarchical Game method. This system is composed of one electricity utility company and one natural gas utility company on the upper level, as well as multiple same-structured smart EHs that can generate electricity and heat simultaneously on the middle level and multiple users on the lower level.Refs. [12, 13] propose an optimal load distribution model for the EH community, which aims to reduce the total cost of the EH community, including operating costs and the cost of CO2 emissions of the system. In this EH, combined heat and power (CHP) unit, boiler, heat storage unit, PV array, wind turbine, and electric vehicles (EVs) are considered. In [14], a cost-based mixed-integer linear programming model is proposed for the short term planning and to obtain the optimum solution for the production and load dispatch in a distribution network containing some EHs. Ref. [15] provides coordinated energy management of EHs across different networks based on the cooperation of hubs in the future markets. The proposed model connects electricity, natural gas, and district heating networks. In addition, a bilevel optimization problem is proposed in [16] for optimal planning of an active distribution system. With this system, the grid sells its surplus electricity to the growing electricity market. A multipurpose optimization problem is formulated in [17] to allocate power supply in smart residential EH and to provide scheduling plans for energy-using equipment alongside conventionally classified devices. An optimal operation model is proposed in [18] to manage multiple EHs with electrical and thermal energy demand, which aims to reduce the total cost of EHs. A robust optimization approach is then proposed to deal with the uncertainty of distributed renewable energy sources and electricity prices. At the same time, the electrical and thermal demand response (DR) programs are considered in the proposed model, and the results of optimal distribution are discussed under independent and accumulation scenarios with and without DR programs. In [19], an interval-stochastic hybrid framework for EH robust programming is proposed, in which thermal and electrical DR applications are provided for flexible energy management to reduce operating costs. In [20], multi-EH system planning is presented in the presence of renewable energy sources with a multiobjective model to reduce the carbon emissions and operation cost.Ref. [21] has discussed the optimization problem in order to reduce the cost of an EH by considering the PV as well as IPL. Also in [22], in order to minimize the impact of unexpected events on the system, a new energy management tool for isolated microgrids that is resistant to failure is presented. In this paper, a stochastic-IGDT formulation is developed, by which typical uncertainties are modeled through scenarios. Ref. [23] has developed an energy management framework that employed flexible demand, storage devices, and electric vehicles. In this reference, a stochastic interval model is proposed to deal with uncertainties of demand, renewable energy generation, vehicle behavior, and energy pricing.In addition, an optimal pricing strategy for an EH is modeled on [24], where the proposed model enabling EH takes advantage of the current and real-time markets. The optimization model is presented in this strategy to manage several market uncertainties, including day-to-day market prices, real-time market prices, and wind generation. Ref. [25] presents a robust optimization approach that is proposed for the planning of multicarrier hub energy systems taking into account the economic and environmental constraints in the presence of multi-DR programs. A model is presented in [26] for EH programming that meets electrical, thermal, and cooling needs and manages controllable on-and-off appliances. Concerns about energy security and environmental protection have raised the need to produce, convert, and use energy in a more efficient, clean, and diverse way. Based on this, a model is presented in [27] for EH design, which combines distributed energy/heating/cooling power supply, renewable energy, and energy storage. These EHs include heating, cooling, power systems, natural gas, and electricity generation, where the photovoltaic units are the primary energy resources. Also, a paradigm and operating model has been proposed for multiple regional energy producers whose energy demand is met by interconnected EHs. The EH residential model which is powered by electricity, natural gas, and solar radiation at its input port meets the electrical, thermal, and cooling needs at the output port [28].Recently, the use of distributed generation sources and EVs has increased to reduce air emission and greenhouse gas emissions. Also, intelligent parking lot (IPL) has increased in response to the increasing number of EVs. Therefore, in [29], optimal energy management is proposed for an IPL that includes renewable energy sources and local distribution generators.


## 1.3. Paper Contributions

Based on the literature review presented, this paper proposes a new method to manage and plan an active distribution network as microgrid in the presence of multiple EHs by considering different components including different storages and responsive loads. In order to clarify the differences between this paper and recent papers in the field of EH planning, Table1 is provided. Therefore, the contributions of this paper are introduced as follows:
(i)
Proposing a microgrid including different types of EHs containing various generation units, converters, and storage units to supply electricity, heating, cooling, and natural gas demands(ii)
Providing optimal performance between EHs with the aim of microgrid benefits maximization(iii)
Providing optimal performance of EVs to meet the electric demand within IPLs(iv)
Considering the uncertainty on the consumed loads types as well as the amount of primary energy of EVs(v)
Using the P2G system in gas-fired units to reduce the emission(vi)
Executing DR program on three demands of electricity, thermal, and cooling energy in the proposed modelingTable 1
Comparison of recent models with the proposed model in this paper.
Ref.Objective functionsNetworkStorage systemIPLP2G unitDRUncertainRenewable resourceESSTSSCSSGSSElectricityThermalCoolingLoadIPLRenewable resource[3]Cost✓✓✓✗✗✗✗✗✗✗✓✗✓✓[4]Cost✓✓✗✗✓✗✓✗✗✗✗✗✗✓[5]Cost✓✓✓✗✗✗✗✓✓✗✓✗✓✓[8]Cost✗✓✓✓✗✗✗✓✗✗✓✗✓✓[9]Cost✓✓✓✗✓✗✓✗✗✗✗✗✓✓[10]Cost✓✗✗✗✗✗✗✗✗✗✓✗✓✓[11]Benefit✓✗✗✗✗✗✗✓✓✗✓✗✗✗[13]Cost✗✗✓✗✗✓✗✓✓✗✓✓✓✓[15]Benefit✓✗✓✗✗✓✗✗✗✗✓✗✓✓[16]Cost✓✓✓✓✗✓✗✓✓✓✓✗✓✓[18]Cost✓✓✗✗✗✗✗✗✗✗✓✗✓✓[19]Cost✗✓✓✗✗✗✗✓✓✗✓✗✓✓[20]Cost✗✓✓✓✗✗✗✓✓✓✓✗✓✓[25]Cost✗✓✓✓✗✗✗✓✗✗✓✗✓✓[26]Cost✗✓✓✓✗✓✗✗✗✗✗✗✗✗[30]Cost✗✓✗✗✗✗✗✓✗✗✓✗✓✓[31]Benefit✗✓✓✗✗✗✗✓✓✗✓✗✓✓[32]Cost✗✓✓✗✗✗✗✓✓✓✗✗✓✓[33]Cost✗✓✓✗✓✗✓✓✓✓✓✗✓✓[34]Cost✗✓✓✓✗✗✗✓✓✓✓✗✓✓[35]Cost✗✓✓✗✗✗✗✓✓✗✓✗✓✓This paperBenefit✓✓✓✓✓✓✓✓✓✓✓✓✓✓


## 2. Energy Hub Structure

Different type of EHs are used to meet the demand for energy in smart grids. These EHs consist of three basic parts: energy sources, converters, and energy storage.(a)
Energy Generation Resources. The resources include upstream electricity and natural gas networks and renewable generation units such as wind turbines and photovoltaic panels(b)
Energy Converters. The employed converters are boilers, electric heat pump (EHP), CHP, electric and absorption chillers, micro turbines, P2G system, and heat recovery systemThe boiler exploited natural gas and converted it to heat to meet heat demand. The EHP unit uses electrical energy consumption to meet heating and cooling demands independently. Electric and absorption chillers act to meet the cooling demand by converting electrical and thermal energy into cooling energy, respectively. The CHP unit works to meet this type of demand by consuming natural gas and converting it into electrical and thermal energy. The microturbine unit converts natural gas into electrical and thermal energy. The heat recovery system, which is employed to use energy efficiently and prevent energy loss, is practically responsible to recover the heat loss from units such as microturbines. Meanwhile, gas-fired units such as boilers, microturbines, and CHP, which need to use natural gas for their activities, endanger the environment by producing carbon dioxide and similar pollutants. Therefore, to deal with this problem, carbon dioxide collection system and P2G system are used to absorb a percentage of carbon dioxide produced and consumed electricity and water and to electrolyze water.(c)
Energy Storage Devices. The energy storage devices, which are actually used to store energy when the price of energy carriers is low and to use the stored energy when the energy price is high, are divided into four categories: electrical, thermal, cooling, and natural gas energy storages. There are two types of electric storage devices, including stand-alone electric batteries and IPLs consisting of EVsIn order to better meet the energy demand with the highest operating benefit and increase the reliability of demand, DR programs are used. These programs operate by shifting demand from peak to off-peak times. Figure1 shows a schematic of an EH to meet various types of electrical, heating, cooling and natural gas demands.Figure 1
An example of an EH structure.


## 3. Problem Formulation

This section proposes a model consisting of an objective function to maximize expected operating benefit and constraints on the EH components.


### 3.1. Objective Function

The proposed stochastic model for unit commitment (UC) in the EH is based on maximizing the expected operating benefit of the EH (OB), which according to (1), can be written as
(1)OB¯=∑iOBi.The operating benefit in each scenario s is evaluated using equations (2) to (12). According to equations (2) to (4a), the operating benefit of each EH includes the benefit of buying and selling electricity upstream (Benefite,i,s) and benefit and cost from the activities of different parts of each EH (Benefiti,s,Costi,s). As equation (4a) shows, the benefit obtained from the activity of different components of each EH is the benefit from the generation of electrical power by the wind turbine and the photovoltaic system (BenefitWTi,PVi,s), microturbine performance (BenefitMTi,s), boiler performance (Benefitsboili,s), EHP performance (BenefitsEHPi,s), P2G system (BenefitsP2Gi,s), electrical chiller and absorption chiller performance (BenefitACi,ECi,s), CHP system (BenefitCHPi,s), performance of storage devices and EVs (BenefitStoragei,s), and performance of demand response programs (BenefitDRi,s).
(2)OBi=∑spsBenefite,i,s+Benefiti,s−Costi,s,(3)Benefite,i,s=∑tPe,i,t,s.πe,t,(4a)Benefiti,s=BenefitWTi,PVi,s+BenefitMTi,s+Benefitboili,s+BenefitEHPi,s+BenefitP2Gi,s+BenefitECi,ACi,s+BenefitCHPi,s+BenefitStoragei,s+BenefitDRi,s,(4b)BenefitWTi,PVi,s=∑tPWTi,t,s.πe,t+∑teffconv.PPVi,t,s.πe,t,(4c)BenefitMTi,s=∑tPMTi,t,s.πe,t+HMTi,t,s.πh,t−NGMTi,t,s.πNG,t+SUDCMTi,t,s,(4d)Benefitboili,s=∑tHboili,t,s.πh,t−Hboili,t,seffboili.πNG,t+SUDCboili,t,s,(4e)BenefitEHPi,s=∑tHEHPi,t,s.πh,t+CEHPi,t,s.πc,t−HEHPi,t,sCOPh,EHP+CEHPi,t,sCOPc,EHP.πe,t+SUDCEHPi,t,s,(4f)BenefitP2Gi,s=∑tNGP2Gi,t,s.πNG,t−PP2Gi,t,s.πe,t,(4g)BenefitACi,ECi,s=∑tCECi,t,s.πc,t−PECi,t,s.πe,t+SUDCECi,t,s+∑tCACi,t,s.πc,t−CACi,t,sCOPACi.πh,t+SUDCACi,t,s,(4h)BenefitCHPi,s=∑tPCHPi,t,s.πe,t+HCHPi,t,s.πh,t−NGCHPi,t,s.πNG,t−SUDCCHPi,t,s,(4i)Benefitstoragei,s=∑t,nevPEVi,nev,t,sdisch−PEVi,nev,t,sch.πe,t−dEVi,sfleet+∑tPbi,t,sdisch−Pbi,t,sch.πe,t−dbi,s+∑tHTSSi,t,sdisch−HTSSi,t,sch.πh,t−dTSSi,s+∑tPCSSi,t,sdisch.πc,t−PCSSi,t,sch.πe,t−dCSSi,s+∑tNGNGSi,t,sdisch−NGNGSi,t,sch.πNG,t,(4j)BenefitDRi,t,s=DRei,t,sdown−DRei,t,sup.πe,t+DRci,t,sdown−DRci,t,sup.πc,t+DRhi,t,sdown−DRhi,t,sup.πh,t.As equation (5a) shows, the cost obtained from the activity of different components of each EH is cost of purchasing natural gas from the upstream network (CostNGi,s), cost of power consumption of CCP system (CostCCPi,s), costs of reducing loads (Costshedi,s), costs due to CO2 emission from the activities of gas-fired units (Costemissioni,s), and financial incentives paid to consumers (DRCi,s).
(5a)Costi,s=CostNGi,s+CostCCPi,s+Costshedi,s+Costemissioni,s+DRCi,s,(5b)CostNGi,s=∑tNGi,t,sg.πNG,t,(5c)CostCCPi,s=∑tPCCPi,t,s.πe,t,(5d)Costshedi,s=∑tPshedei,t,s.VLLe+∑tHshedhi,t,s.VLLh+∑tCshedci,t,s.VLLc,(5e)Costemissioni,s=∑tTCE1i,t,s+TCE2i,t,s.πCT∀i=1,∑tTboili,t,s.πCT∀i=2,3,∑tTMTi,t,s.πCT∀i=4.The total incentive plan for demand response is presented as (6a) and consists of electrical, heating, and cooling incentives.
(6a)DRCi,s=∑carrieriDRCcarrieri,s,where(6b)DRCcarrieri,s=∑tDRIcarrierDRcarrieri,t,sup+DRcarrieri,t,sdown,∀carrier∈electrical,cooling,heating.The cost of starting and stopping different units is obtained according to equations (7)–(12).
(7)SUDCMTi,t,s=uMTi,t,ssuSUMT+uMTi,t,ssdSDMT,(8)SUDCboili,t,s=yboili,t,sSUboil+zboili,t,sSDboil,(9)SUDCEHPi,t,s=yEHPi,t,sSUEHP+zEHPi,t,sSDEHP,(10)SUDCECi,t,s=yECi,t,sSUEC+zECi,t,sSDEC,(11)SUDCACi,t,s=yACi,t,sSUAC+zACi,t,sSDAC,(12)SUDCCHPi,t,s=SUCostCHPi,t,s+SDCostCHPi,t,s.According to (13)-(16) proposition, the destruction cost of storage systems (dbi,s, dTSSi,s, dCSSi,s, and dEVi,sfleet) is proportional to their replacement cost, total charge, and discharge power and inversely related to their total discharge capacity.
(13)dbi,s=RCbTCDCb∑tPbi,t,sdisch+Pbi,t,sch,(14)dTSSi,s=RCTSSTCDCTSS∑tHTSSi,t,sdisch+HTSSi,t,sch,(15)dCSSi,s=RCCSSTCDCCSS∑tPCSSi,t,sdisch+PCSSi,t,sch,(16)dEVi,sfleet=∑nevRCEVi,nevTCDCEVi,nev∑tPEVi,nev,t,sdisch+PEVi,nev,t,sch.


### 3.2. Constraints of Energy Hubs

Constraints on EHs’ operation can be categorized into 14 groups, which will be discussed in detail.


#### 3.2.1. Energy Balance

The power supply balance of the EH is guaranteed by (17). According to this relation, the hub’s electrical generation should be equal to its electrical demand at any given time.
(17)Pe,i,t,s+effconv.PPVi,t,s+PCHPi,t,s+∑nevPEVi,nev,t,sdisch+PWTi,t,s+PMTi,t,s+Pshedei,t,s+Pbi,t,sdisch+DRei,t,sdown=De,i,t,s+DRei,t,sup+∑nevPEVi,nev,t,sch+Pbi,t,sch+PECi,t,s+PP2Gi,t,s+PCCPi,t,s+PCSSi,t,sch+HEHPi,t,sCOPh,EHP+CEHPi,t,sCOPc,EHP∀t,s,i.The same concept is also valid for heating and cooling carriers described as equations (18) and (19).
(18)Hboili,t,s+HCHPi,t,s+Hshedhi,t,s+HHRi,t,s+HEHPi,t,s+HTSSi,t,sdisch+DRhi,t,sdown=Dhi,t,s+DRhi,t,sup+HTSSi,t,sch+CACi,t,sCOPAC∀t,s,i,(19)CACi,t,s+CECi,t,s+PCSSi,t,sdisch+CEHPi,t,s+Cshedci,t,s+DRci,t,sdown=Dci,t,s+DRci,t,sup∀t,s,i.Since natural gas has a key impact on the hub’s operation, the constraint applied to its supply and demand is considered in (20).
(20)NGi,t,sg+NGP2Gi,t,s+NGNGSi,t,sdisch=Hboil,t,seffboil+NGCHPi,t,s+NGNGSi,t,sch+NGMTi,t,s+DNG,t,s∀t,s,i.


#### 3.2.2. Electric and Gas Power Flow

The equilibrium of electrical energy within the grid is performed through the formulations in this subsection. The calculated electrical power is flowed over the grid to meet the consumers’ electrical power demand. The calculation is performed via equations (21) to (25). The parameters Pe,n,t,s and De,n,t,s in (21) are the generated and consumed powers for each bus at each time. Also, the variables δn,t,s and δm,t,s are the voltage angles related to nth and mth busses. The variable Pn,m,t,sline shows the line power between the busses n and m at any time introduced in (22) whose line capacity value is limited by (23). Equations (24) and (25) determine the electrical load of each bus and the reference bus angle, respectively.
(21)Pe,n,t,s−De,n,t,sPBase=∑mδn,t,s−δm,t,sXn,m∀t,s,(22)Pn,m,t,slinePBase=δn,t,s−δm,t,sXn,m∀n,m,t,s,(23)−Pmaxline≤Pn,m,t,sline≤Pmaxline∀n,m,t,s,(24)De,n,t,s=LFn×PtDe∀n,t,s,(25)δn=1,t,s=0∀t,s.References to natural gas transmission lines within the microgrid are also given in [36].


#### 3.2.3. Responsive Program for Heating, Electric, and Cooling Loads

The shift-up and shift-down of electrical loads in the DR are limited by equations (26) and (27). According to equations (26) and (27), at any time and in any scenario, the shift-up (DRei,t,sup) and shift-down (DRei,t,sdown) electricity demand is limited by the shift-up (DPFe,up) and shift-down (DPFe,down) electric demand share coefficient, which is equal to electric demand.
(26)DRei,t,sup≤DPFe,up.Dei,t,s.uDR,ei,t,sup,(27)DRei,t,sdown≤DPFe,down.Dei,t,s.uDR,ei,t,sdown.Equation (28) ensures that at any given time and scenario, electricity demand cannot be shifted up and down simultaneously.
(28)uDR,ei,t,sup+uDR,ei,t,sdown≤1.Equation (29) ensures that in each scenario, the sum of the shift-up electrical demand over the operation span is equal to the total shift-down electrical demand.
(29)∑tDRei,t,sup=∑tDRei,t,sdown.The constraints related to the shift of heating and cooling loads are also the same as those related to the electrical load shift [37].


#### 3.2.4. Plug-In Hybrid Electric Vehicles (PHEVs)

Today’s PHEV can exchange electric power in an economical way based on real-time power tariffs with the grid so that they can be charged in nonpeak hours and discharged during peak hours. In order to intelligently manage PHEV charging and discharging mechanisms, some limitations need to be met.In the proposed method, according to the EHs type, two types of IPL involving electric vehicles are considered. In this regard, the performance of electric vehicles in the commercial hub IPL is such that they are in the parking lot during the day. In other words, charging and discharging occur during the day. This issue happens in the opposite way for the residential hub. It means that charging and discharging happen at night. It should be noted that this behavior is applied on limitations using time periods.Limits for charging and discharging PHEV batteries at any time intervalt are given as follows:
(30)uEVi,nev,t,schPchEV,nev,min≤PEVi,nev,t,sch≤uEVi,nev,t,schPchEV,nev,max,(31)uEVi,nev,t,sdischPdchEV,nev,min≤PEVi,nev,t,sdisch≤uEVi,nev,t,sdischPdchEV,nev,max.Given that the PHEV battery is in charge or discharge mode at any time interval (t), the following equation must be established:
(32)uEVi,nev,t,sch+uEVi,nev,t,sdisch≤1.Limitations for minimum and maximum PHEV battery capacity are as follows:(33)EEV,nev,min≤EEVi,nev,t,s≤EEV,nev,max.Also, the battery energy (EEVi,nev,t,s) content of PHEVs for the time period is written as follows:
(34)EEVi,nev,t,s=EEVi,nev,t−1,s−PEVi,nev,t,sdischeffEV,nevdisch+effEV,nevchPEVi,nev,t,sch−LFEV,nevEEVi,nev,t,s+EEVi,nev,t−1,s2.To ensure that the energy content of the PHEVs battery reaches its initial value after a scheduling cycle, the following restriction is implemented:(35)EEVi,nev,ini,s=EEVi,nev,end,s.


#### 3.2.5. Battery Energy Storage System

The operation of an electric storage device is subject to restrictions similar to those relating to electric vehicles. The difference between the relations is that the energy storage system, unlike electric vehicles, can be charged and discharged at all hours of the operation span. According to (36) and (37), the energy level of the electrical storage at any time (Ebi,t,s) is equal to the sum of its previous energy level and the energy added during the charging process minus the total storage loss and discharge energy from the storage electricity.
(36)Ebi,t,s=Ebi,t−1,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,t−1,s2∀t≠1,(37)Ebi,t,s=Ebi,ini,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,ini,s2∀t=1.It should be noted that in these equations, the level of electrical energy storage should be within its limits applied by (38).
(38)Eb,min≤Eb,t,s≤Eb,max.Also, the electrical energy storage cannot experience charging and discharging at the same time. So, this can be performed via (39).
(39)ub,t,sch+ub,t,sdisch≤1.Finally, the energy level of the electrical storage at the end of the operating time horizon should be equal to its initial energy level. This is performed by (40).
(40)Eb,ini,s=Eb,end,s.


#### 3.2.6. Thermal Storage System (TSS)

The TSS function is similar to charging and discharging a PHEV battery. Limitations on the TSS charge level at the final time stage can be expressed as follows:(41)Etssi,t,s=Etssi,t−1,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,t−1,s2∀t≠1,(42)Etssi,t,s=Etssi,ini,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should be considered for the TSS as well.


#### 3.2.7. Cooling Storage System

The charge level limitations of the cooling storage can be defined as (43) and (44).
(43)Ecssi,t,s=Ecssi,t−1,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,t−1,s2∀t≠1,(44)Ecssi,t,s=Ecssi,ini,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should also be considered in a suitable way for the cold storage device.


#### 3.2.8. CHP

The CHP unit uses natural gas at the inlet, at peak times, or when the hub operator is appropriate, to supply that amount of energy through the CHP unit instead of purchasing electrical or thermal energy from the main grid. The CHP unit generates electrical and thermal energy by reference relations [36].


#### 3.2.9. Boiler

The operation of boilers used to generate heat is subject to various restrictions. The boiler and all other EH components have been assumed ON at the beginning of the operation horizon. Constraints (45)–(48) define boiler start-up and shut-down indicators, i.e., yboili,t,s and zboili,t,s.
(45)yboili,t,s−zboili,t,s=uboili,t,s−uboili,t−1,s∀t≠1,(46)yboili,t,s=0∀t=1,(47)zboili,t,s=1−uboili,t,s∀t=1,(48)yboili,t,s+zboili,t,s≤1.Equation (49) ensures that at any given time and scenario, the committed boiler heat is limited to a predetermined allowable range.
(49)Hboil,minuboili,t,s≤Hboili,t,s≤Hboil,maxuboili,t,s.Equations (50) and (51) ensure that the boiler heat output (Hboili,t,s) does not exceed the incremental and slope reduction rates at any given time and scenario.
(50)Hboili,t+1,s−Hboili,t,s≤RUboil∀t≠24,(51)Hboili,t−1,s−Hboili,t,s≤RDboil∀t≠1.


#### 3.2.10. P2G and CCP Units

Equation (52) limits the amount of operation of a P2G facility. The relationship between the synthesized natural gas (NGP2Gi,t,s) and the electric power consumed by P2G (PP2Gi,t,s) is shown by equation (53). Equations (54) to (59) are related to P2G gas storage. Equation (60) shows the function of CCP, which is to receive CO2 from what is produced inside the EH. Equation (61) means that the amount of CO2 required for natural gas synthesis should not exceed the amount of CO2 absorbed by the CCP. Equations (62) and (63) show the formation of CO2 emissions, and the electrical power consumed by the CCP (PCCPi,t,s) is calculated based on (64).
(52)0≤PP2Gi,t,s≤PP2G,max,(53)NGP2Gi,t,s=μP2GngPP2Gi,t,s,(54)0≤uNGCi,t,s+uNGDi,t,s≤1,(55)Nt,s=N0+∑j=1tNGNGSi,j,schηNGCΔt−∑j=1tNGNGSi,j,sdischηNGDΔt,(56)NT,s=N0,s,(57)0≤NGNGSi,t,sch≤uNGCi,t,sNGmaxch,(58)0≤NGNGSi,t,sdisch≤uNGDi,t,sNGmaxdisch,(59)Nmin≤Nt,s≤Nmax,(60)TCCPi,t,s≤μCCTMTi,t,s+Tboili,t,s,(61)TP2Gi,t,s=μP2GCO2PP2Gi,t,s≤TCCPi,t,s,(62)TCE1i,t,s=TMTi,t,s+Tboili,t,s−TCCPi,t,s,(63)TCE2i,t,s=TCCPi,t,s−TP2Gi,t,s,(64)PCCPi,t,s=μCCPTCCPi,t,s.


#### 3.2.11. Microturbine (MT)

The constraints presented in equations (65) and (66) indicate the start-up mode (uMTi,t,ssu) and shut-down of the MT (uMTi,t,ssd) at different times. Equations (67) and (68) show the forced outage duration of the MT. Equation (69) shows the relationship between electrical and thermal power produced by MTs. Equations (70) and (71) limit the amount of electrical power produced by a MT (PMTi,t,s).Equations (72) and (73) also represent the amount of gas consumed (NGMTi,t,s) and the amount of carbon dioxide (TMTi,t,s) produced by MT, respectively.
(65)−uMTi,t,ssd≤uMTi,t,so−uMTi,t−1,so≤uMTi,t,ssu∀t≠1,(66)0≤uMTi,t,ssu+uMTi,t,ssd≤1,(67)TMTu,MINuMTi,t,ssu≤∑h=tt+TMTu,MIN−1uMTi,t,so∀t≤T−TMTu,MIN+1,(68)TMTd,MINuMTi,t,ssd≤∑h=tt+TMTu,MIN−11−uMTi,t,so∀t≤T−TMTd,MIN+1,(69)HMTi,t,s=PMTi,t,s1−ηMT−ηIηMTCOPh,(70)uMTi,t,soPMT,min≤PMTi,t,s≤PMT,maxuMTi,t,so,(71)−rMT≤PMTi,t,s−PMTi,t−1,s≤rMT∀t≠1,(72)NGMTi,t,s=1LHVngηMTPMTi,t,s,(73)TMTi,t,s=μMTPMTi,t,s.


#### 3.2.12. Heat Recovery System

This heat recovery system is located as a thermal energy interface between the MT and the heat load defined as follows:(74)HHRi,t,s=ηHRHMTi,t,s.


#### 3.2.13. EHP Unit

EHP operation is subject to various restrictions. These limitations can be seen in [37].


#### 3.2.14. Absorption Chiller and Electric Chiller

Absorption chillers use thermal energy as the main source for cooling. Absorption chiller performance is limited by limits (75) to (81). Constraints (75) to (78) define start-up (yACi,t,s) and absorption chiller stop (zACi,t,s) indicators.
(75)yACi,t,s−zACi,t,s=uACi,t,s−uACi,t−1,s∀t≠1,(76)yACi,t,s=0∀t=1,(77)zACi,t,s=1−uACi,t,s∀t=1,(78)yACi,t,s+zACi,t,s≤1.Equation (79) ensures that the cooling capacity of the absorption chiller (CACi,t,s) is limited within its predetermined range.
(79)CAC,minuACi,t,s≤CACi,t,s≤CAC,maxuACi,t,s.Equations (80) and (81), respectively, ensure that the increase and decrease of the absorption chiller cooling capacity do not exceed the rate of increase (RUAC) and decrease (RDAC) of its slope.
(80)CACi,t+1,s−CACi,t,s≤RUAC∀t≠24,(81)CACi,t−1,s−CACi,t,s≤RDAC∀t≠1.The operation of an electric chiller is limited by equations (82) to (88). Limits (82) to (85) define start-up (yECi,t,s) and electric chiller stop (zECi,t,s) indicators. Constraint (86) ensures that the cooling capacity of the committed electric chiller (CECi,t,s) is limited within its predetermined range. Equations (87) and (88), respectively, ensure that the increase and decrease of the electric chiller cooling capacity do not exceed the rate of increase (RUEC) and decrease (RDEC) of its slope.
(82)yECi,t,s−zECi,t,s=uECi,t,s−uECi,t−1,s∀t≠1,(83)yECi,t,s=0∀t=1,(84)zECi,t,s=1−uECi,t,s∀t=1,(85)yECi,t,s+zECi,t,s≤1,(86)CEC,minuECi,t,s≤CECi,t,s≤CEC,maxuECi,t,s,(87)CECi,t+1,s−CECi,t,s≤RUEC∀t≠24,(88)CECi,t−1,s−CECi,t,s≤RDEC∀t≠1.


## 3.1. Objective Function

The proposed stochastic model for unit commitment (UC) in the EH is based on maximizing the expected operating benefit of the EH (OB), which according to (1), can be written as
(1)OB¯=∑iOBi.The operating benefit in each scenario s is evaluated using equations (2) to (12). According to equations (2) to (4a), the operating benefit of each EH includes the benefit of buying and selling electricity upstream (Benefite,i,s) and benefit and cost from the activities of different parts of each EH (Benefiti,s,Costi,s). As equation (4a) shows, the benefit obtained from the activity of different components of each EH is the benefit from the generation of electrical power by the wind turbine and the photovoltaic system (BenefitWTi,PVi,s), microturbine performance (BenefitMTi,s), boiler performance (Benefitsboili,s), EHP performance (BenefitsEHPi,s), P2G system (BenefitsP2Gi,s), electrical chiller and absorption chiller performance (BenefitACi,ECi,s), CHP system (BenefitCHPi,s), performance of storage devices and EVs (BenefitStoragei,s), and performance of demand response programs (BenefitDRi,s).
(2)OBi=∑spsBenefite,i,s+Benefiti,s−Costi,s,(3)Benefite,i,s=∑tPe,i,t,s.πe,t,(4a)Benefiti,s=BenefitWTi,PVi,s+BenefitMTi,s+Benefitboili,s+BenefitEHPi,s+BenefitP2Gi,s+BenefitECi,ACi,s+BenefitCHPi,s+BenefitStoragei,s+BenefitDRi,s,(4b)BenefitWTi,PVi,s=∑tPWTi,t,s.πe,t+∑teffconv.PPVi,t,s.πe,t,(4c)BenefitMTi,s=∑tPMTi,t,s.πe,t+HMTi,t,s.πh,t−NGMTi,t,s.πNG,t+SUDCMTi,t,s,(4d)Benefitboili,s=∑tHboili,t,s.πh,t−Hboili,t,seffboili.πNG,t+SUDCboili,t,s,(4e)BenefitEHPi,s=∑tHEHPi,t,s.πh,t+CEHPi,t,s.πc,t−HEHPi,t,sCOPh,EHP+CEHPi,t,sCOPc,EHP.πe,t+SUDCEHPi,t,s,(4f)BenefitP2Gi,s=∑tNGP2Gi,t,s.πNG,t−PP2Gi,t,s.πe,t,(4g)BenefitACi,ECi,s=∑tCECi,t,s.πc,t−PECi,t,s.πe,t+SUDCECi,t,s+∑tCACi,t,s.πc,t−CACi,t,sCOPACi.πh,t+SUDCACi,t,s,(4h)BenefitCHPi,s=∑tPCHPi,t,s.πe,t+HCHPi,t,s.πh,t−NGCHPi,t,s.πNG,t−SUDCCHPi,t,s,(4i)Benefitstoragei,s=∑t,nevPEVi,nev,t,sdisch−PEVi,nev,t,sch.πe,t−dEVi,sfleet+∑tPbi,t,sdisch−Pbi,t,sch.πe,t−dbi,s+∑tHTSSi,t,sdisch−HTSSi,t,sch.πh,t−dTSSi,s+∑tPCSSi,t,sdisch.πc,t−PCSSi,t,sch.πe,t−dCSSi,s+∑tNGNGSi,t,sdisch−NGNGSi,t,sch.πNG,t,(4j)BenefitDRi,t,s=DRei,t,sdown−DRei,t,sup.πe,t+DRci,t,sdown−DRci,t,sup.πc,t+DRhi,t,sdown−DRhi,t,sup.πh,t.As equation (5a) shows, the cost obtained from the activity of different components of each EH is cost of purchasing natural gas from the upstream network (CostNGi,s), cost of power consumption of CCP system (CostCCPi,s), costs of reducing loads (Costshedi,s), costs due to CO2 emission from the activities of gas-fired units (Costemissioni,s), and financial incentives paid to consumers (DRCi,s).
(5a)Costi,s=CostNGi,s+CostCCPi,s+Costshedi,s+Costemissioni,s+DRCi,s,(5b)CostNGi,s=∑tNGi,t,sg.πNG,t,(5c)CostCCPi,s=∑tPCCPi,t,s.πe,t,(5d)Costshedi,s=∑tPshedei,t,s.VLLe+∑tHshedhi,t,s.VLLh+∑tCshedci,t,s.VLLc,(5e)Costemissioni,s=∑tTCE1i,t,s+TCE2i,t,s.πCT∀i=1,∑tTboili,t,s.πCT∀i=2,3,∑tTMTi,t,s.πCT∀i=4.The total incentive plan for demand response is presented as (6a) and consists of electrical, heating, and cooling incentives.
(6a)DRCi,s=∑carrieriDRCcarrieri,s,where(6b)DRCcarrieri,s=∑tDRIcarrierDRcarrieri,t,sup+DRcarrieri,t,sdown,∀carrier∈electrical,cooling,heating.The cost of starting and stopping different units is obtained according to equations (7)–(12).
(7)SUDCMTi,t,s=uMTi,t,ssuSUMT+uMTi,t,ssdSDMT,(8)SUDCboili,t,s=yboili,t,sSUboil+zboili,t,sSDboil,(9)SUDCEHPi,t,s=yEHPi,t,sSUEHP+zEHPi,t,sSDEHP,(10)SUDCECi,t,s=yECi,t,sSUEC+zECi,t,sSDEC,(11)SUDCACi,t,s=yACi,t,sSUAC+zACi,t,sSDAC,(12)SUDCCHPi,t,s=SUCostCHPi,t,s+SDCostCHPi,t,s.According to (13)-(16) proposition, the destruction cost of storage systems (dbi,s, dTSSi,s, dCSSi,s, and dEVi,sfleet) is proportional to their replacement cost, total charge, and discharge power and inversely related to their total discharge capacity.
(13)dbi,s=RCbTCDCb∑tPbi,t,sdisch+Pbi,t,sch,(14)dTSSi,s=RCTSSTCDCTSS∑tHTSSi,t,sdisch+HTSSi,t,sch,(15)dCSSi,s=RCCSSTCDCCSS∑tPCSSi,t,sdisch+PCSSi,t,sch,(16)dEVi,sfleet=∑nevRCEVi,nevTCDCEVi,nev∑tPEVi,nev,t,sdisch+PEVi,nev,t,sch.


## 3.2. Constraints of Energy Hubs

Constraints on EHs’ operation can be categorized into 14 groups, which will be discussed in detail.


### 3.2.1. Energy Balance

The power supply balance of the EH is guaranteed by (17). According to this relation, the hub’s electrical generation should be equal to its electrical demand at any given time.
(17)Pe,i,t,s+effconv.PPVi,t,s+PCHPi,t,s+∑nevPEVi,nev,t,sdisch+PWTi,t,s+PMTi,t,s+Pshedei,t,s+Pbi,t,sdisch+DRei,t,sdown=De,i,t,s+DRei,t,sup+∑nevPEVi,nev,t,sch+Pbi,t,sch+PECi,t,s+PP2Gi,t,s+PCCPi,t,s+PCSSi,t,sch+HEHPi,t,sCOPh,EHP+CEHPi,t,sCOPc,EHP∀t,s,i.The same concept is also valid for heating and cooling carriers described as equations (18) and (19).
(18)Hboili,t,s+HCHPi,t,s+Hshedhi,t,s+HHRi,t,s+HEHPi,t,s+HTSSi,t,sdisch+DRhi,t,sdown=Dhi,t,s+DRhi,t,sup+HTSSi,t,sch+CACi,t,sCOPAC∀t,s,i,(19)CACi,t,s+CECi,t,s+PCSSi,t,sdisch+CEHPi,t,s+Cshedci,t,s+DRci,t,sdown=Dci,t,s+DRci,t,sup∀t,s,i.Since natural gas has a key impact on the hub’s operation, the constraint applied to its supply and demand is considered in (20).
(20)NGi,t,sg+NGP2Gi,t,s+NGNGSi,t,sdisch=Hboil,t,seffboil+NGCHPi,t,s+NGNGSi,t,sch+NGMTi,t,s+DNG,t,s∀t,s,i.


### 3.2.2. Electric and Gas Power Flow

The equilibrium of electrical energy within the grid is performed through the formulations in this subsection. The calculated electrical power is flowed over the grid to meet the consumers’ electrical power demand. The calculation is performed via equations (21) to (25). The parameters Pe,n,t,s and De,n,t,s in (21) are the generated and consumed powers for each bus at each time. Also, the variables δn,t,s and δm,t,s are the voltage angles related to nth and mth busses. The variable Pn,m,t,sline shows the line power between the busses n and m at any time introduced in (22) whose line capacity value is limited by (23). Equations (24) and (25) determine the electrical load of each bus and the reference bus angle, respectively.
(21)Pe,n,t,s−De,n,t,sPBase=∑mδn,t,s−δm,t,sXn,m∀t,s,(22)Pn,m,t,slinePBase=δn,t,s−δm,t,sXn,m∀n,m,t,s,(23)−Pmaxline≤Pn,m,t,sline≤Pmaxline∀n,m,t,s,(24)De,n,t,s=LFn×PtDe∀n,t,s,(25)δn=1,t,s=0∀t,s.References to natural gas transmission lines within the microgrid are also given in [36].


### 3.2.3. Responsive Program for Heating, Electric, and Cooling Loads

The shift-up and shift-down of electrical loads in the DR are limited by equations (26) and (27). According to equations (26) and (27), at any time and in any scenario, the shift-up (DRei,t,sup) and shift-down (DRei,t,sdown) electricity demand is limited by the shift-up (DPFe,up) and shift-down (DPFe,down) electric demand share coefficient, which is equal to electric demand.
(26)DRei,t,sup≤DPFe,up.Dei,t,s.uDR,ei,t,sup,(27)DRei,t,sdown≤DPFe,down.Dei,t,s.uDR,ei,t,sdown.Equation (28) ensures that at any given time and scenario, electricity demand cannot be shifted up and down simultaneously.
(28)uDR,ei,t,sup+uDR,ei,t,sdown≤1.Equation (29) ensures that in each scenario, the sum of the shift-up electrical demand over the operation span is equal to the total shift-down electrical demand.
(29)∑tDRei,t,sup=∑tDRei,t,sdown.The constraints related to the shift of heating and cooling loads are also the same as those related to the electrical load shift [37].


### 3.2.4. Plug-In Hybrid Electric Vehicles (PHEVs)

Today’s PHEV can exchange electric power in an economical way based on real-time power tariffs with the grid so that they can be charged in nonpeak hours and discharged during peak hours. In order to intelligently manage PHEV charging and discharging mechanisms, some limitations need to be met.In the proposed method, according to the EHs type, two types of IPL involving electric vehicles are considered. In this regard, the performance of electric vehicles in the commercial hub IPL is such that they are in the parking lot during the day. In other words, charging and discharging occur during the day. This issue happens in the opposite way for the residential hub. It means that charging and discharging happen at night. It should be noted that this behavior is applied on limitations using time periods.Limits for charging and discharging PHEV batteries at any time intervalt are given as follows:
(30)uEVi,nev,t,schPchEV,nev,min≤PEVi,nev,t,sch≤uEVi,nev,t,schPchEV,nev,max,(31)uEVi,nev,t,sdischPdchEV,nev,min≤PEVi,nev,t,sdisch≤uEVi,nev,t,sdischPdchEV,nev,max.Given that the PHEV battery is in charge or discharge mode at any time interval (t), the following equation must be established:
(32)uEVi,nev,t,sch+uEVi,nev,t,sdisch≤1.Limitations for minimum and maximum PHEV battery capacity are as follows:(33)EEV,nev,min≤EEVi,nev,t,s≤EEV,nev,max.Also, the battery energy (EEVi,nev,t,s) content of PHEVs for the time period is written as follows:
(34)EEVi,nev,t,s=EEVi,nev,t−1,s−PEVi,nev,t,sdischeffEV,nevdisch+effEV,nevchPEVi,nev,t,sch−LFEV,nevEEVi,nev,t,s+EEVi,nev,t−1,s2.To ensure that the energy content of the PHEVs battery reaches its initial value after a scheduling cycle, the following restriction is implemented:(35)EEVi,nev,ini,s=EEVi,nev,end,s.


### 3.2.5. Battery Energy Storage System

The operation of an electric storage device is subject to restrictions similar to those relating to electric vehicles. The difference between the relations is that the energy storage system, unlike electric vehicles, can be charged and discharged at all hours of the operation span. According to (36) and (37), the energy level of the electrical storage at any time (Ebi,t,s) is equal to the sum of its previous energy level and the energy added during the charging process minus the total storage loss and discharge energy from the storage electricity.
(36)Ebi,t,s=Ebi,t−1,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,t−1,s2∀t≠1,(37)Ebi,t,s=Ebi,ini,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,ini,s2∀t=1.It should be noted that in these equations, the level of electrical energy storage should be within its limits applied by (38).
(38)Eb,min≤Eb,t,s≤Eb,max.Also, the electrical energy storage cannot experience charging and discharging at the same time. So, this can be performed via (39).
(39)ub,t,sch+ub,t,sdisch≤1.Finally, the energy level of the electrical storage at the end of the operating time horizon should be equal to its initial energy level. This is performed by (40).
(40)Eb,ini,s=Eb,end,s.


### 3.2.6. Thermal Storage System (TSS)

The TSS function is similar to charging and discharging a PHEV battery. Limitations on the TSS charge level at the final time stage can be expressed as follows:(41)Etssi,t,s=Etssi,t−1,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,t−1,s2∀t≠1,(42)Etssi,t,s=Etssi,ini,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should be considered for the TSS as well.


### 3.2.7. Cooling Storage System

The charge level limitations of the cooling storage can be defined as (43) and (44).
(43)Ecssi,t,s=Ecssi,t−1,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,t−1,s2∀t≠1,(44)Ecssi,t,s=Ecssi,ini,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should also be considered in a suitable way for the cold storage device.


### 3.2.8. CHP

The CHP unit uses natural gas at the inlet, at peak times, or when the hub operator is appropriate, to supply that amount of energy through the CHP unit instead of purchasing electrical or thermal energy from the main grid. The CHP unit generates electrical and thermal energy by reference relations [36].


### 3.2.9. Boiler

The operation of boilers used to generate heat is subject to various restrictions. The boiler and all other EH components have been assumed ON at the beginning of the operation horizon. Constraints (45)–(48) define boiler start-up and shut-down indicators, i.e., yboili,t,s and zboili,t,s.
(45)yboili,t,s−zboili,t,s=uboili,t,s−uboili,t−1,s∀t≠1,(46)yboili,t,s=0∀t=1,(47)zboili,t,s=1−uboili,t,s∀t=1,(48)yboili,t,s+zboili,t,s≤1.Equation (49) ensures that at any given time and scenario, the committed boiler heat is limited to a predetermined allowable range.
(49)Hboil,minuboili,t,s≤Hboili,t,s≤Hboil,maxuboili,t,s.Equations (50) and (51) ensure that the boiler heat output (Hboili,t,s) does not exceed the incremental and slope reduction rates at any given time and scenario.
(50)Hboili,t+1,s−Hboili,t,s≤RUboil∀t≠24,(51)Hboili,t−1,s−Hboili,t,s≤RDboil∀t≠1.


### 3.2.10. P2G and CCP Units

Equation (52) limits the amount of operation of a P2G facility. The relationship between the synthesized natural gas (NGP2Gi,t,s) and the electric power consumed by P2G (PP2Gi,t,s) is shown by equation (53). Equations (54) to (59) are related to P2G gas storage. Equation (60) shows the function of CCP, which is to receive CO2 from what is produced inside the EH. Equation (61) means that the amount of CO2 required for natural gas synthesis should not exceed the amount of CO2 absorbed by the CCP. Equations (62) and (63) show the formation of CO2 emissions, and the electrical power consumed by the CCP (PCCPi,t,s) is calculated based on (64).
(52)0≤PP2Gi,t,s≤PP2G,max,(53)NGP2Gi,t,s=μP2GngPP2Gi,t,s,(54)0≤uNGCi,t,s+uNGDi,t,s≤1,(55)Nt,s=N0+∑j=1tNGNGSi,j,schηNGCΔt−∑j=1tNGNGSi,j,sdischηNGDΔt,(56)NT,s=N0,s,(57)0≤NGNGSi,t,sch≤uNGCi,t,sNGmaxch,(58)0≤NGNGSi,t,sdisch≤uNGDi,t,sNGmaxdisch,(59)Nmin≤Nt,s≤Nmax,(60)TCCPi,t,s≤μCCTMTi,t,s+Tboili,t,s,(61)TP2Gi,t,s=μP2GCO2PP2Gi,t,s≤TCCPi,t,s,(62)TCE1i,t,s=TMTi,t,s+Tboili,t,s−TCCPi,t,s,(63)TCE2i,t,s=TCCPi,t,s−TP2Gi,t,s,(64)PCCPi,t,s=μCCPTCCPi,t,s.


### 3.2.11. Microturbine (MT)

The constraints presented in equations (65) and (66) indicate the start-up mode (uMTi,t,ssu) and shut-down of the MT (uMTi,t,ssd) at different times. Equations (67) and (68) show the forced outage duration of the MT. Equation (69) shows the relationship between electrical and thermal power produced by MTs. Equations (70) and (71) limit the amount of electrical power produced by a MT (PMTi,t,s).Equations (72) and (73) also represent the amount of gas consumed (NGMTi,t,s) and the amount of carbon dioxide (TMTi,t,s) produced by MT, respectively.
(65)−uMTi,t,ssd≤uMTi,t,so−uMTi,t−1,so≤uMTi,t,ssu∀t≠1,(66)0≤uMTi,t,ssu+uMTi,t,ssd≤1,(67)TMTu,MINuMTi,t,ssu≤∑h=tt+TMTu,MIN−1uMTi,t,so∀t≤T−TMTu,MIN+1,(68)TMTd,MINuMTi,t,ssd≤∑h=tt+TMTu,MIN−11−uMTi,t,so∀t≤T−TMTd,MIN+1,(69)HMTi,t,s=PMTi,t,s1−ηMT−ηIηMTCOPh,(70)uMTi,t,soPMT,min≤PMTi,t,s≤PMT,maxuMTi,t,so,(71)−rMT≤PMTi,t,s−PMTi,t−1,s≤rMT∀t≠1,(72)NGMTi,t,s=1LHVngηMTPMTi,t,s,(73)TMTi,t,s=μMTPMTi,t,s.


### 3.2.12. Heat Recovery System

This heat recovery system is located as a thermal energy interface between the MT and the heat load defined as follows:(74)HHRi,t,s=ηHRHMTi,t,s.


### 3.2.13. EHP Unit

EHP operation is subject to various restrictions. These limitations can be seen in [37].


### 3.2.14. Absorption Chiller and Electric Chiller

Absorption chillers use thermal energy as the main source for cooling. Absorption chiller performance is limited by limits (75) to (81). Constraints (75) to (78) define start-up (yACi,t,s) and absorption chiller stop (zACi,t,s) indicators.
(75)yACi,t,s−zACi,t,s=uACi,t,s−uACi,t−1,s∀t≠1,(76)yACi,t,s=0∀t=1,(77)zACi,t,s=1−uACi,t,s∀t=1,(78)yACi,t,s+zACi,t,s≤1.Equation (79) ensures that the cooling capacity of the absorption chiller (CACi,t,s) is limited within its predetermined range.
(79)CAC,minuACi,t,s≤CACi,t,s≤CAC,maxuACi,t,s.Equations (80) and (81), respectively, ensure that the increase and decrease of the absorption chiller cooling capacity do not exceed the rate of increase (RUAC) and decrease (RDAC) of its slope.
(80)CACi,t+1,s−CACi,t,s≤RUAC∀t≠24,(81)CACi,t−1,s−CACi,t,s≤RDAC∀t≠1.The operation of an electric chiller is limited by equations (82) to (88). Limits (82) to (85) define start-up (yECi,t,s) and electric chiller stop (zECi,t,s) indicators. Constraint (86) ensures that the cooling capacity of the committed electric chiller (CECi,t,s) is limited within its predetermined range. Equations (87) and (88), respectively, ensure that the increase and decrease of the electric chiller cooling capacity do not exceed the rate of increase (RUEC) and decrease (RDEC) of its slope.
(82)yECi,t,s−zECi,t,s=uECi,t,s−uECi,t−1,s∀t≠1,(83)yECi,t,s=0∀t=1,(84)zECi,t,s=1−uECi,t,s∀t=1,(85)yECi,t,s+zECi,t,s≤1,(86)CEC,minuECi,t,s≤CECi,t,s≤CEC,maxuECi,t,s,(87)CECi,t+1,s−CECi,t,s≤RUEC∀t≠24,(88)CECi,t−1,s−CECi,t,s≤RDEC∀t≠1.


## 3.2.1. Energy Balance

The power supply balance of the EH is guaranteed by (17). According to this relation, the hub’s electrical generation should be equal to its electrical demand at any given time.
(17)Pe,i,t,s+effconv.PPVi,t,s+PCHPi,t,s+∑nevPEVi,nev,t,sdisch+PWTi,t,s+PMTi,t,s+Pshedei,t,s+Pbi,t,sdisch+DRei,t,sdown=De,i,t,s+DRei,t,sup+∑nevPEVi,nev,t,sch+Pbi,t,sch+PECi,t,s+PP2Gi,t,s+PCCPi,t,s+PCSSi,t,sch+HEHPi,t,sCOPh,EHP+CEHPi,t,sCOPc,EHP∀t,s,i.The same concept is also valid for heating and cooling carriers described as equations (18) and (19).
(18)Hboili,t,s+HCHPi,t,s+Hshedhi,t,s+HHRi,t,s+HEHPi,t,s+HTSSi,t,sdisch+DRhi,t,sdown=Dhi,t,s+DRhi,t,sup+HTSSi,t,sch+CACi,t,sCOPAC∀t,s,i,(19)CACi,t,s+CECi,t,s+PCSSi,t,sdisch+CEHPi,t,s+Cshedci,t,s+DRci,t,sdown=Dci,t,s+DRci,t,sup∀t,s,i.Since natural gas has a key impact on the hub’s operation, the constraint applied to its supply and demand is considered in (20).
(20)NGi,t,sg+NGP2Gi,t,s+NGNGSi,t,sdisch=Hboil,t,seffboil+NGCHPi,t,s+NGNGSi,t,sch+NGMTi,t,s+DNG,t,s∀t,s,i.


## 3.2.2. Electric and Gas Power Flow

The equilibrium of electrical energy within the grid is performed through the formulations in this subsection. The calculated electrical power is flowed over the grid to meet the consumers’ electrical power demand. The calculation is performed via equations (21) to (25). The parameters Pe,n,t,s and De,n,t,s in (21) are the generated and consumed powers for each bus at each time. Also, the variables δn,t,s and δm,t,s are the voltage angles related to nth and mth busses. The variable Pn,m,t,sline shows the line power between the busses n and m at any time introduced in (22) whose line capacity value is limited by (23). Equations (24) and (25) determine the electrical load of each bus and the reference bus angle, respectively.
(21)Pe,n,t,s−De,n,t,sPBase=∑mδn,t,s−δm,t,sXn,m∀t,s,(22)Pn,m,t,slinePBase=δn,t,s−δm,t,sXn,m∀n,m,t,s,(23)−Pmaxline≤Pn,m,t,sline≤Pmaxline∀n,m,t,s,(24)De,n,t,s=LFn×PtDe∀n,t,s,(25)δn=1,t,s=0∀t,s.References to natural gas transmission lines within the microgrid are also given in [36].


## 3.2.3. Responsive Program for Heating, Electric, and Cooling Loads

The shift-up and shift-down of electrical loads in the DR are limited by equations (26) and (27). According to equations (26) and (27), at any time and in any scenario, the shift-up (DRei,t,sup) and shift-down (DRei,t,sdown) electricity demand is limited by the shift-up (DPFe,up) and shift-down (DPFe,down) electric demand share coefficient, which is equal to electric demand.
(26)DRei,t,sup≤DPFe,up.Dei,t,s.uDR,ei,t,sup,(27)DRei,t,sdown≤DPFe,down.Dei,t,s.uDR,ei,t,sdown.Equation (28) ensures that at any given time and scenario, electricity demand cannot be shifted up and down simultaneously.
(28)uDR,ei,t,sup+uDR,ei,t,sdown≤1.Equation (29) ensures that in each scenario, the sum of the shift-up electrical demand over the operation span is equal to the total shift-down electrical demand.
(29)∑tDRei,t,sup=∑tDRei,t,sdown.The constraints related to the shift of heating and cooling loads are also the same as those related to the electrical load shift [37].


## 3.2.4. Plug-In Hybrid Electric Vehicles (PHEVs)

Today’s PHEV can exchange electric power in an economical way based on real-time power tariffs with the grid so that they can be charged in nonpeak hours and discharged during peak hours. In order to intelligently manage PHEV charging and discharging mechanisms, some limitations need to be met.In the proposed method, according to the EHs type, two types of IPL involving electric vehicles are considered. In this regard, the performance of electric vehicles in the commercial hub IPL is such that they are in the parking lot during the day. In other words, charging and discharging occur during the day. This issue happens in the opposite way for the residential hub. It means that charging and discharging happen at night. It should be noted that this behavior is applied on limitations using time periods.Limits for charging and discharging PHEV batteries at any time intervalt are given as follows:
(30)uEVi,nev,t,schPchEV,nev,min≤PEVi,nev,t,sch≤uEVi,nev,t,schPchEV,nev,max,(31)uEVi,nev,t,sdischPdchEV,nev,min≤PEVi,nev,t,sdisch≤uEVi,nev,t,sdischPdchEV,nev,max.Given that the PHEV battery is in charge or discharge mode at any time interval (t), the following equation must be established:
(32)uEVi,nev,t,sch+uEVi,nev,t,sdisch≤1.Limitations for minimum and maximum PHEV battery capacity are as follows:(33)EEV,nev,min≤EEVi,nev,t,s≤EEV,nev,max.Also, the battery energy (EEVi,nev,t,s) content of PHEVs for the time period is written as follows:
(34)EEVi,nev,t,s=EEVi,nev,t−1,s−PEVi,nev,t,sdischeffEV,nevdisch+effEV,nevchPEVi,nev,t,sch−LFEV,nevEEVi,nev,t,s+EEVi,nev,t−1,s2.To ensure that the energy content of the PHEVs battery reaches its initial value after a scheduling cycle, the following restriction is implemented:(35)EEVi,nev,ini,s=EEVi,nev,end,s.


## 3.2.5. Battery Energy Storage System

The operation of an electric storage device is subject to restrictions similar to those relating to electric vehicles. The difference between the relations is that the energy storage system, unlike electric vehicles, can be charged and discharged at all hours of the operation span. According to (36) and (37), the energy level of the electrical storage at any time (Ebi,t,s) is equal to the sum of its previous energy level and the energy added during the charging process minus the total storage loss and discharge energy from the storage electricity.
(36)Ebi,t,s=Ebi,t−1,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,t−1,s2∀t≠1,(37)Ebi,t,s=Ebi,ini,s−Pbi,t,sdischeffbdisch+effbchPbi,t,sch−SLFbEbi,t,s+Ebi,ini,s2∀t=1.It should be noted that in these equations, the level of electrical energy storage should be within its limits applied by (38).
(38)Eb,min≤Eb,t,s≤Eb,max.Also, the electrical energy storage cannot experience charging and discharging at the same time. So, this can be performed via (39).
(39)ub,t,sch+ub,t,sdisch≤1.Finally, the energy level of the electrical storage at the end of the operating time horizon should be equal to its initial energy level. This is performed by (40).
(40)Eb,ini,s=Eb,end,s.


## 3.2.6. Thermal Storage System (TSS)

The TSS function is similar to charging and discharging a PHEV battery. Limitations on the TSS charge level at the final time stage can be expressed as follows:(41)Etssi,t,s=Etssi,t−1,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,t−1,s2∀t≠1,(42)Etssi,t,s=Etssi,ini,s−Htssi,t,sdischefftssdisch+efftsschHtssi,t,sch−SLFtssEtssi,t,s+Etssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should be considered for the TSS as well.


## 3.2.7. Cooling Storage System

The charge level limitations of the cooling storage can be defined as (43) and (44).
(43)Ecssi,t,s=Ecssi,t−1,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,t−1,s2∀t≠1,(44)Ecssi,t,s=Ecssi,ini,s−Pcssi,t,sdischeffcssdisch+effcsschPcssi,t,sch−SLFcssEcssi,t,s+Ecssi,ini,s2∀t=1.It should be noted that the constraints (38) to (40) that are presented for the BESS system should also be considered in a suitable way for the cold storage device.


## 3.2.8. CHP

The CHP unit uses natural gas at the inlet, at peak times, or when the hub operator is appropriate, to supply that amount of energy through the CHP unit instead of purchasing electrical or thermal energy from the main grid. The CHP unit generates electrical and thermal energy by reference relations [36].


## 3.2.9. Boiler

The operation of boilers used to generate heat is subject to various restrictions. The boiler and all other EH components have been assumed ON at the beginning of the operation horizon. Constraints (45)–(48) define boiler start-up and shut-down indicators, i.e., yboili,t,s and zboili,t,s.
(45)yboili,t,s−zboili,t,s=uboili,t,s−uboili,t−1,s∀t≠1,(46)yboili,t,s=0∀t=1,(47)zboili,t,s=1−uboili,t,s∀t=1,(48)yboili,t,s+zboili,t,s≤1.Equation (49) ensures that at any given time and scenario, the committed boiler heat is limited to a predetermined allowable range.
(49)Hboil,minuboili,t,s≤Hboili,t,s≤Hboil,maxuboili,t,s.Equations (50) and (51) ensure that the boiler heat output (Hboili,t,s) does not exceed the incremental and slope reduction rates at any given time and scenario.
(50)Hboili,t+1,s−Hboili,t,s≤RUboil∀t≠24,(51)Hboili,t−1,s−Hboili,t,s≤RDboil∀t≠1.


## 3.2.10. P2G and CCP Units

Equation (52) limits the amount of operation of a P2G facility. The relationship between the synthesized natural gas (NGP2Gi,t,s) and the electric power consumed by P2G (PP2Gi,t,s) is shown by equation (53). Equations (54) to (59) are related to P2G gas storage. Equation (60) shows the function of CCP, which is to receive CO2 from what is produced inside the EH. Equation (61) means that the amount of CO2 required for natural gas synthesis should not exceed the amount of CO2 absorbed by the CCP. Equations (62) and (63) show the formation of CO2 emissions, and the electrical power consumed by the CCP (PCCPi,t,s) is calculated based on (64).
(52)0≤PP2Gi,t,s≤PP2G,max,(53)NGP2Gi,t,s=μP2GngPP2Gi,t,s,(54)0≤uNGCi,t,s+uNGDi,t,s≤1,(55)Nt,s=N0+∑j=1tNGNGSi,j,schηNGCΔt−∑j=1tNGNGSi,j,sdischηNGDΔt,(56)NT,s=N0,s,(57)0≤NGNGSi,t,sch≤uNGCi,t,sNGmaxch,(58)0≤NGNGSi,t,sdisch≤uNGDi,t,sNGmaxdisch,(59)Nmin≤Nt,s≤Nmax,(60)TCCPi,t,s≤μCCTMTi,t,s+Tboili,t,s,(61)TP2Gi,t,s=μP2GCO2PP2Gi,t,s≤TCCPi,t,s,(62)TCE1i,t,s=TMTi,t,s+Tboili,t,s−TCCPi,t,s,(63)TCE2i,t,s=TCCPi,t,s−TP2Gi,t,s,(64)PCCPi,t,s=μCCPTCCPi,t,s.


## 3.2.11. Microturbine (MT)

The constraints presented in equations (65) and (66) indicate the start-up mode (uMTi,t,ssu) and shut-down of the MT (uMTi,t,ssd) at different times. Equations (67) and (68) show the forced outage duration of the MT. Equation (69) shows the relationship between electrical and thermal power produced by MTs. Equations (70) and (71) limit the amount of electrical power produced by a MT (PMTi,t,s).Equations (72) and (73) also represent the amount of gas consumed (NGMTi,t,s) and the amount of carbon dioxide (TMTi,t,s) produced by MT, respectively.
(65)−uMTi,t,ssd≤uMTi,t,so−uMTi,t−1,so≤uMTi,t,ssu∀t≠1,(66)0≤uMTi,t,ssu+uMTi,t,ssd≤1,(67)TMTu,MINuMTi,t,ssu≤∑h=tt+TMTu,MIN−1uMTi,t,so∀t≤T−TMTu,MIN+1,(68)TMTd,MINuMTi,t,ssd≤∑h=tt+TMTu,MIN−11−uMTi,t,so∀t≤T−TMTd,MIN+1,(69)HMTi,t,s=PMTi,t,s1−ηMT−ηIηMTCOPh,(70)uMTi,t,soPMT,min≤PMTi,t,s≤PMT,maxuMTi,t,so,(71)−rMT≤PMTi,t,s−PMTi,t−1,s≤rMT∀t≠1,(72)NGMTi,t,s=1LHVngηMTPMTi,t,s,(73)TMTi,t,s=μMTPMTi,t,s.


## 3.2.12. Heat Recovery System

This heat recovery system is located as a thermal energy interface between the MT and the heat load defined as follows:(74)HHRi,t,s=ηHRHMTi,t,s.


## 3.2.13. EHP Unit

EHP operation is subject to various restrictions. These limitations can be seen in [37].


## 3.2.14. Absorption Chiller and Electric Chiller

Absorption chillers use thermal energy as the main source for cooling. Absorption chiller performance is limited by limits (75) to (81). Constraints (75) to (78) define start-up (yACi,t,s) and absorption chiller stop (zACi,t,s) indicators.
(75)yACi,t,s−zACi,t,s=uACi,t,s−uACi,t−1,s∀t≠1,(76)yACi,t,s=0∀t=1,(77)zACi,t,s=1−uACi,t,s∀t=1,(78)yACi,t,s+zACi,t,s≤1.Equation (79) ensures that the cooling capacity of the absorption chiller (CACi,t,s) is limited within its predetermined range.
(79)CAC,minuACi,t,s≤CACi,t,s≤CAC,maxuACi,t,s.Equations (80) and (81), respectively, ensure that the increase and decrease of the absorption chiller cooling capacity do not exceed the rate of increase (RUAC) and decrease (RDAC) of its slope.
(80)CACi,t+1,s−CACi,t,s≤RUAC∀t≠24,(81)CACi,t−1,s−CACi,t,s≤RDAC∀t≠1.The operation of an electric chiller is limited by equations (82) to (88). Limits (82) to (85) define start-up (yECi,t,s) and electric chiller stop (zECi,t,s) indicators. Constraint (86) ensures that the cooling capacity of the committed electric chiller (CECi,t,s) is limited within its predetermined range. Equations (87) and (88), respectively, ensure that the increase and decrease of the electric chiller cooling capacity do not exceed the rate of increase (RUEC) and decrease (RDEC) of its slope.
(82)yECi,t,s−zECi,t,s=uECi,t,s−uECi,t−1,s∀t≠1,(83)yECi,t,s=0∀t=1,(84)zECi,t,s=1−uECi,t,s∀t=1,(85)yECi,t,s+zECi,t,s≤1,(86)CEC,minuECi,t,s≤CECi,t,s≤CEC,maxuECi,t,s,(87)CECi,t+1,s−CECi,t,s≤RUEC∀t≠24,(88)CECi,t−1,s−CECi,t,s≤RDEC∀t≠1.


## 4. Proposed Algorithm in Problem Solving

In this section, the method of solving the model proposed in the previous section is presented to maximize the total profit of the microgrid and reduce the emission level of the complex. In this model, the uncertainty of loads and renewable production and the amount of primary energy of electric vehicles are considered. In addition to the mentioned cases, this algorithm establishes communication between different EHs and also prevents the removal of EH load.The proposed algorithm is illustrated in Figure2. The steps of this algorithm are described as follows.Step 1.
In this algorithm, the information about the system under study is first collected, and demand-responsive programs are set up to better meet the energy consumption of consumers. Then, the location of the EHs in the microgrid must be determined.Step 2.
In this step, the predetermined information should be adjusted according to the behavior of consumers in the past days. This information is related to all types of consumption including electrical, heating, cooling, and gas. Also, the production of photovoltaic system and wind turbine should be collected according to climate changes. In addition to the mentioned items, the price of energy carriers is also determined.Step 3.
Using the information collected in the previous two steps, a scenario is generated for the model presented in the previous section by employing Monte Carlo method in this step. For the model considered by GAMS software, 1000 scenarios are generated. Then, to reduce the amount of input information, the number of scenarios is reduced to 10 that is likely to occur. It should be noted that in order for the performance of EVs to be close to the real state, the amount of initial energy in the battery of EVs is variable for each vehicle in the time period [19, 23], while the time of the vehicle in the parking lot is also variable.Figure 2
Flowchart of the proposed modeling solution.The approach related to the generation and reduction of scenarios is given in Section5.Step 4.
In this step, the generated scenarios are applied to the desired model, which includes three types of EHs. The number of hubs implemented in the microgrid according to their type are two residential hubs, one commercial hub and one industrial hub.Step 5.
In this step, the optimization of the objective function of the system under study is performed according to equation (1), while considering the benefit of all EHs; this process goes on until the equilibrium condition of the energy carriers equals the existence of production with consumption within EHs; otherwise, production units must be rescheduled to meet demand.Step 6.
Finally, at the end of the planning period, the final results related to solving this model will be extracted, which will contain the maximum benefit of EHs and the economic distribution of hub products to meet the system demand.


## 5. Method of Modeling the Uncertainty

This section presents distribution functions and the process of generating and reducing scenarios.


### 5.1. Probability Distribution Function

The distribution functions used to fit the historical data of uncertain parameters are as follows.(i)
Probability distribution function for wind powerFitting the historical data for wind power is done based on the Weibull distribution function. Weibull probability density distribution function is defined as follows:(89)fwv=kcvck−1×exp−vck,where v is the speed (power) of the wind, and the parameters c and k are called the scale parameter and the shape coefficient of the function, respectively. fwv is the probability of occurrence of speed v (or power related to speed v).
(ii)
Probability distribution function for PV powerThe historical data of PV generation is also fitted based on the beta distribution function. The probability distribution function of solar power density is obtained as follows.(90)fPtPV=1Bmt,ntPtPVPmaxPVmt−1.1−PtPVPmaxPVmt−1,(91)Bmt,nt=ΓmtΓntΓmt+Γnt,(92)mt=μtPVμtPV.1−μtPVσt,PV2−1,(93)nt=1−μtPV.μtPV.1−μtPVσt,PV2−1,where Bmt,nt is the beta function for solar radiation with parameters m and n; μ is the average value and σ is the variance of solar radiation, and fPtPV is the probability of occurrence of power at time t.
(iii)
Probability distribution function for loadThe load historical data are fitted through normal distribution function, which is defined by (94). Using this, the probability of the generated scenarios can be calculated.
(94)fx;μ,σ2=12πσ2e−x−μ2/2σ2,where fx represents the probability of occurrence of load level x, and μ and σ2 are the mean value and variance of the normal distribution, respectively.
(iv)
Probability distribution function for the primary energy of electric vehiclesThe historical data related to the amount of primary energy of electric vehicles are fitted by the normal distribution function, just like the function used for the load.


### 5.2. Scenario Generation and Reduction

The purpose of this part is to explain the operation of scenario-based method for modeling the uncertainties of the understudy problem. Therefore, the method of generating the scenarios and also their reduction is initially presented here [38].Figures3 and 4 represent the procedure of scenario generation method. The following steps describe the procedure employed.Step 1.
As the distribution functions of each uncertain parameter continues, it is required to change in a discrete mode, and proper occurrence probabilities are characterized for them. This process may result in errors, which should be taken into consideration.Step 2.
It is required to design a cumulative distribution function for the equation achieved at the last step. The pieces of Figures3 and 4 are randomly sorted so that they are correspondent to each other. All available uncertain variables in the problem need to go through this process.Step 3.
The process of scenario generation can be continued by operating roulette wheel mechanism. Here, all the available uncertain variables in the problem should be individually analyzed to determine their percentage of errors and occurrence probabilities.Step 4.
At this step, the variables of each scenario should be updated to proper new ones, and new values for them should be calculated and collected with the percentage of error for each one.Step 5.
Finally, the total probability of the scenario that is equal to the multiplication of all the calculated probabilities of variables should be determined.Figure 3
Typical discretization of the probability distribution functions of the load level forecast error.Figure 4
Accumulated normalized probabilities of the forecast error levels.These steps should be repeated until the desirable number of scenarios is satisfied. These abovementioned steps concerning the scenario generation are presented as a flowchart in Figure5.Figure 5
Flowchart of the scenario generation process.A large number of these generated scenarios result in disturbance in simulation and reduce the speed of processing. Therefore, operating a method to reduce these scenarios is necessary. Here, the backward method that decreases the number of scenarios and computational burden is subsequently used. The description of this reduction method is as follows:Before explaining the steps of the method, we have to considerρs as the probability of a scenario, DTs,s′ as the distance of a couple of scenarios, and the scenario set as ξss=1,⋯,Ns.Step 1.
At first, before any processing two sets ass and Ds should be considered which are allocated for acceptable and unacceptable scenarios. The considered Ds set should be initially empty. As the first calculation, apply the following equation to determine the distance of all couples of scenarios:
(95)DTs,s′=DTξs,ξs′=∑i=1dxis−xis′s,s′∈S.Step 2.
At this step, the minimum distance of (r and k) scenario pairs should be calculated by applying the following equation:
(96)DTk,r=minDTk,s′k,s′∈S;s≠k.Step 3.
After that,PDk,r and PDd should be characterized by the following operating equations.
(97)PDk,r=ρk×DTk,rk∈S,(98)PDd=minPDkk∈S.Step 4.
New scenario sets are achieved according to (99).
(99)S=S−d,DS=DS+d,ρr=ρr+ρd.Step 5.
The desirable reduction is accessible by repeating Steps2 to 4.By applying the above procedure, the reduction of scenarios will be obtained for uncertainty modeling of the problem. Now, the uncertain problem is ready to be solved. These abovementioned steps concerning the scenario reduction are presented as a flowchart in Figure6.Figure 6
Flowchart of the scenario reduction process.The result of equation (100) is called the coefficient change. This criterion presents the estimation accuracy of the simulation process. The sample values of this criterion should be calculated throughout the process to be examined for recognizing the desirable performance of the process.
(100)cvf=σfμfNs.In order to recognize the stopping constraint, it is not required to check all scenarios because the results of simulation are sorted in some groups allocated for specified scenarios. The simulation process will be continued until the value ofcvf is decreased to less than the predetermined tolerance.


## 5.1. Probability Distribution Function

The distribution functions used to fit the historical data of uncertain parameters are as follows.(i)
Probability distribution function for wind powerFitting the historical data for wind power is done based on the Weibull distribution function. Weibull probability density distribution function is defined as follows:(89)fwv=kcvck−1×exp−vck,where v is the speed (power) of the wind, and the parameters c and k are called the scale parameter and the shape coefficient of the function, respectively. fwv is the probability of occurrence of speed v (or power related to speed v).
(ii)
Probability distribution function for PV powerThe historical data of PV generation is also fitted based on the beta distribution function. The probability distribution function of solar power density is obtained as follows.(90)fPtPV=1Bmt,ntPtPVPmaxPVmt−1.1−PtPVPmaxPVmt−1,(91)Bmt,nt=ΓmtΓntΓmt+Γnt,(92)mt=μtPVμtPV.1−μtPVσt,PV2−1,(93)nt=1−μtPV.μtPV.1−μtPVσt,PV2−1,where Bmt,nt is the beta function for solar radiation with parameters m and n; μ is the average value and σ is the variance of solar radiation, and fPtPV is the probability of occurrence of power at time t.
(iii)
Probability distribution function for loadThe load historical data are fitted through normal distribution function, which is defined by (94). Using this, the probability of the generated scenarios can be calculated.
(94)fx;μ,σ2=12πσ2e−x−μ2/2σ2,where fx represents the probability of occurrence of load level x, and μ and σ2 are the mean value and variance of the normal distribution, respectively.
(iv)
Probability distribution function for the primary energy of electric vehiclesThe historical data related to the amount of primary energy of electric vehicles are fitted by the normal distribution function, just like the function used for the load.


## 5.2. Scenario Generation and Reduction

The purpose of this part is to explain the operation of scenario-based method for modeling the uncertainties of the understudy problem. Therefore, the method of generating the scenarios and also their reduction is initially presented here [38].Figures3 and 4 represent the procedure of scenario generation method. The following steps describe the procedure employed.Step 1.
As the distribution functions of each uncertain parameter continues, it is required to change in a discrete mode, and proper occurrence probabilities are characterized for them. This process may result in errors, which should be taken into consideration.Step 2.
It is required to design a cumulative distribution function for the equation achieved at the last step. The pieces of Figures3 and 4 are randomly sorted so that they are correspondent to each other. All available uncertain variables in the problem need to go through this process.Step 3.
The process of scenario generation can be continued by operating roulette wheel mechanism. Here, all the available uncertain variables in the problem should be individually analyzed to determine their percentage of errors and occurrence probabilities.Step 4.
At this step, the variables of each scenario should be updated to proper new ones, and new values for them should be calculated and collected with the percentage of error for each one.Step 5.
Finally, the total probability of the scenario that is equal to the multiplication of all the calculated probabilities of variables should be determined.Figure 3
Typical discretization of the probability distribution functions of the load level forecast error.Figure 4
Accumulated normalized probabilities of the forecast error levels.These steps should be repeated until the desirable number of scenarios is satisfied. These abovementioned steps concerning the scenario generation are presented as a flowchart in Figure5.Figure 5
Flowchart of the scenario generation process.A large number of these generated scenarios result in disturbance in simulation and reduce the speed of processing. Therefore, operating a method to reduce these scenarios is necessary. Here, the backward method that decreases the number of scenarios and computational burden is subsequently used. The description of this reduction method is as follows:Before explaining the steps of the method, we have to considerρs as the probability of a scenario, DTs,s′ as the distance of a couple of scenarios, and the scenario set as ξss=1,⋯,Ns.Step 1.
At first, before any processing two sets ass and Ds should be considered which are allocated for acceptable and unacceptable scenarios. The considered Ds set should be initially empty. As the first calculation, apply the following equation to determine the distance of all couples of scenarios:
(95)DTs,s′=DTξs,ξs′=∑i=1dxis−xis′s,s′∈S.Step 2.
At this step, the minimum distance of (r and k) scenario pairs should be calculated by applying the following equation:
(96)DTk,r=minDTk,s′k,s′∈S;s≠k.Step 3.
After that,PDk,r and PDd should be characterized by the following operating equations.
(97)PDk,r=ρk×DTk,rk∈S,(98)PDd=minPDkk∈S.Step 4.
New scenario sets are achieved according to (99).
(99)S=S−d,DS=DS+d,ρr=ρr+ρd.Step 5.
The desirable reduction is accessible by repeating Steps2 to 4.By applying the above procedure, the reduction of scenarios will be obtained for uncertainty modeling of the problem. Now, the uncertain problem is ready to be solved. These abovementioned steps concerning the scenario reduction are presented as a flowchart in Figure6.Figure 6
Flowchart of the scenario reduction process.The result of equation (100) is called the coefficient change. This criterion presents the estimation accuracy of the simulation process. The sample values of this criterion should be calculated throughout the process to be examined for recognizing the desirable performance of the process.
(100)cvf=σfμfNs.In order to recognize the stopping constraint, it is not required to check all scenarios because the results of simulation are sorted in some groups allocated for specified scenarios. The simulation process will be continued until the value ofcvf is decreased to less than the predetermined tolerance.


## 6. Case Study and Results

In the proposed procedure, the DR program study on different types of loads within the microgrid, including various EHs, as well as the impact of the P2G system and the IPL on the spread of emission are considered. In order to evaluate the proposed method, the presented algorithm is applied to the modified IEEE 33-Bus network. It should be noted that the modeling is solved by using the GAMS platform under CPLEX 12.1 solver.


### 6.1. Understudy Network and Presentation of EHs

In order to plan the microgrid optimal performance, a modified IEEE 33-Bus test network has been utilized as a microgrid [39]. This microgrid consists of three types of residential, industrial, and commercial EHs. Since the supply of electricity and gas can be performed through the electricity and the natural gas distribution networks, respectively, two upstream networks are intended for this purpose. Heating and cooling requirements are met locally. The specifications of the natural gas distribution system are given in [36].The diagram of the test network with EHs and types of loads s shown in Figure7. In this understudy microgrid system, an industrial EH, two residential EHs, and a commercial EH are considered, which are located at busses numbered 16, 21, 24, and 29, respectively.Figure 7
Test grid with different types of EHs.The electrical loads on these hubs are marked with purple, pink, and yellow colors, respectively, and the loads are shown with black color. All these loads, except for gas, participate in the demand response program.In the residential EH, energy sources include the upstream electricity and gas networks and the photovoltaic system. Also, in this hub, the considered energy converters include boiler, EHP, and absorption chiller. In addition, this EH includes electrical storage, heating, and cooling, as well as IPL with a capacity of 30 electric vehicles. In the commercial EH, the sources of energy production include the upstream electricity and gas networks, and the considered energy converters include CHP, compression chiller, absorption chiller, microturbine, and P2G system. In addition, this EH includes an IPL with a capacity of 30 electric vehicles. In the industrial EH, the energy sources include the upstream electricity and gas networks and wind turbine, and the considered energy converters include boiler, CHP, compression chiller, absorption chiller, microturbine, and P2G system. In addition, this EH includes electrical, heating, and cooling storages. All three types of these EHs are required to provide electrical, heating, and cooling loads. It should be noted that the operating hours are intended for residential IPL at night and for commercial one during the day.Their components are listed in Table2. The prices of energy carriers other than natural gas, which are considered constant, as well as the information of storage systems are shown in Figure 8 and Table 3, respectively.Table 2
Components of EHs.
Industrial hubCommercial hubResidential hubUpstream power grid✓✓✓Upstream gas network✓✓✓Photovoltaic panel✗✗✓Wind turbine✓✗✗Boiler✓✗✓EHP✗✗✓Absorption chiller✓✓✓Electric chiller✓✓✗CHP✗✓✗P2G✓✓✗HRD✓✓✗Microturbine✓✓✗Battery✓✗✓Intelligent parking lots✗✓✓Cooling storage✓✗✓Heat storage✓✗✓Figure 8
Energy carrier prices (electricity, cooling, and heating).Table 3
Information storage systems.
ParameterStorage systemElectricThermalCoolingEV batteriesMinimum charge power10101010Maximum charge power40403040Minimum discharge power10101010Maximum discharge power40403040Charging efficiency0.950.920.95Discharge efficiency0.950.90.950.95Minimum energy20202015Maximum energy15015010075Initial energy20202020Loss coefficient0.010.010.010.01Replacement cost2000050005000200000Charge-discharge capacity4e64e64e64e6Table4 provides information on the components used in EHs. The loads applied to EHs vary depending on the type. Consumption profiles for different types of loads are illustrated in Figure 9. Finally, the energy production profile by wind turbine and PV units is shown in Figure 10.Table 4
Parameters of components EHs.
Boiler output heat range50-220 kwCOP absorption chiller0.75EHP heat output range20-110 kwElectric DR incentives1 cents/kWhEHP cooling output range20-110 kWThermal DR incentives0.5 cents/kWhAC cooling output range20-70 kWCooling DR incentives0.3 cents/kWhMaximum cold produced by EC560 kWParticipation coefficient for electric, thermal, and cooling DR0.2Electric power range of microturbines30-200 kWValue of lost electric load1 $/kWhMaximum heat output HR240 kWValue of lost thermal load0.5 $/kWhMaximum P2G power consumption200 kWValue of lost cooling load0.5 $/kWhThermal value of natural gas9.7 kWh/m3Transformer efficiency0.95Electrical power efficiency of micro turbines0.35PV converter efficiency0.95Microturbine heat loss rate0.1Price NG3 cents/kWhHR thermal efficiency0.75Scheduling horizon1 hEC efficiency0.95Cooling ramp down of EHP110 kW/hGas storage charge and discharge efficiency0.9Heat ramp up of EHP110 kW/hCoefficient of response of electric power to CO2/natural gas for P2G1.35/0.6 kg/kWhRamp up of boiler50 kW/hCCP carbon adsorption efficiency0.9Ramp up of chiller30 kW/hPower consumption factor for CCP0.12 kW/kgCooling ramp up of EHP40 kW/hCO2 emission intensity MT/GB0.32/0.51 kg/kWRamp down of boiler220 kW/hRamping rate MT60 kWRamp down of chiller45 kW/hMinimum on/off time for MT4 hHeat ramp down of EHP110 kW/hStart-up cost of boiler10$Number of electric vehicles30Start-up cost of EHP4$Not available time electric vehicles in the residential parking lot6-18Start-up cost of AC3$Available time electric vehicles in the commercial parking lot6-18Start-up cost of EC3$Boiler efficiency0.85Shut down cost of boiler10$COP thermal EHP3.5Shut down cost of EHP4$COP cooling EHP3.5Shut down cost of chiller4$Minimum electrical and thermal power produced by CHP0.4 MWCHP electrical efficiency0.42Maximum electrical and thermal power produced by CHP4 MWCHP thermal efficiency0.47Cost of starting and stopping CHP10$Figure 9
Load profiles (a) electrical, (b) cooling, (c) heating, and (d) natural gas for the EHs.
(a)(b)(c)(d)Figure 10
Power produced by PV and wind turbine units.


### 6.2. Planning Results in the Test System

In this subsection, the simulation results are examined under different case studies in terms of the impact of load shifting, IPLs, and P2G system employment. This approach simultaneously tries to optimize the amount of energy production and consequently save energy consumption, leading to an increase in the overall benefit of the system.


#### 6.2.1. The Effect of Load Shifting on the Microgrid Performance

According to the DR programs, consumers change their electrical load from the electricity peak price to the off-peak time in order to reduce the cost of the network to meet the demand and provide the energy needed. They also transfer their cooling and heating loads from peak time to off-peak according to the load consumption profile. Following this, the operator will provide the energy at a lower price to provide the load, and in exchange, the operator will pay the consumers as a reward for this load shifting, which is less than the cost of the supply during the peak price time. Figures11–13 show the load shifting on the electrical, heating, and cooling loads of industrial, residential, and commercial EHs, respectively.Figure 11
Shifting load (a) electric, (b) heating, and (c) cooling for industrial EH.
(a)(b)(c)Figure 12
Shifting load (a) electric, (b) heating, and (c) cooling for residential EH.
(a)(b)(c)Figure 13
Shifting load (a) electric, (b) heating, and (c) cooling for commercial EH.
(a)(b)(c)(1) Power Exchanged with the Upstream Network. After the optimal use of the generation capacity inside the hubs, its surplus or shortage is exchanged with the upstream network to supply energy. Figure 14 shows the amount of electrical energy and natural gas exchanged with the upstream network in two modes with and without load shifting.Figure 14
(a) Electricity and (b) natural gas exchanged with the upstream grid.
(a)(b)By comparing the two curves shown in Figure14 in case of load shifting, it is considered that the amount of load that must be provided at the electricity peak price is shifted to off-peak time, and the amount of electricity and natural gas purchased from the upstream network is also shifted.(2) Load-Shedding. The results of the load shifting effect are determined when the load shifting is not included, since the heating and cooling loads are met locally during peak hour consumption. As the internal energy generation of the EHs will not be able to supply the demand during this time, the load-shedding occurs. In the load shifting mode using DR programs, this load value is transferred to low-load times and does not meet the load-shedding by paying a high cost. Figure 15 shows the amount of cooling load-shedding in the absence of load shifting in the network for industrial, residential, and commercial applications.Figure 15
The amount of cooling energy shedding in different types of EHs.(3) Different Component Performance of the EHs.
(i)
MicroturbineFigure16 shows the amount of electrical energy and heating produced by MTs in two modes of with and without load shifting, respectively. As can be seen, the production capacity of MTs increases at nonpeak electricity prices when load shifting is taken into account, because according to Figure 11(a), the electric charge has shifted from the peak time to the nonpeak time of the electricity price.
(ii)
BoilerFigure 16
(a) Electricity and (b) heating generations by MTs.
(a)(b)The cooling generation by the absorption chiller in the industrial EH is completely stopped at hours 17 to 24, and practically, the heat consumption is reduced during these hours. Since the heat production of the industrial EH MT is increased, and consequently, the amount of heat production by the boiler is reduced, so by increasing the energy production of the MT, its heat and electricity production actually increases at the same time. Surplus production is exchanged through the power grid. Of course, the heat generated by the boiler cannot be exchanged because the heating distribution network is not considered. Since, the heat generated by the residential EH’s boiler is used to produce the cooling by the absorption chiller, and by applying load shifting, the cooling load is reduced during peak demand times, and the thermal energy consumption is reduced by the absorption chiller for cooling production. Due to the fact that cooling and heating loads are provided locally, the excess thermal power generated cannot be sold to the upstream network; therefore, the boiler production is reduced. Figure17 shows the amount of heat generated by the industrial and residential boilers in two modes with and without load shifting.
(iii)
Absorption chillerFigure 17
The amount of heating produced by the boiler in two modes with and without load shifting for (a) industrial and (b) residential EHs.
(a)(b)As can be seen from Figure18, the amount of cooling produced by the absorption chiller has been transferred from 18 to 24 hours to 2 to 9 hours in the mode with regard to load shift compared to the mode without load shift. This is because the price of electricity is lower during these hours, and the operation of the MT can be used to generate the heat consumed by the chiller during these hours. The amount of cooling produced by the residential EH absorption chiller in the load shift mode is reduced compared to the non-shift load mode at the peak cooling consumption. This amount of reduction is transmitted to the nonpeak time via load shift and is provided by EHP. Cooling production by commercial EH absorption chiller increases in 4-8 hours. The reason for this increase is the production of more heat by the MT during these hours, which provides the heat consumed by the absorption chiller.
(iv)
EHP unitFigure 18
Production cooling of absorption chiller of EH (a) industrial, (b) residential, and (c) commercial in shift mode and without shift load.
(a)(b)(c)Due to an increase in load at nonpeak load, the cooling output of the EHP unit also increases, but its heat output decreases. Figure19 depicts the amount of heat and cold generated by the EHP; this unit has generated both heat and cold at the same time. Of course, this apparent synchronicity is due to the fact that the total output of the EHP unit in these figures is present in all scenarios, and it is possible for the EHP unit to generate heat from one scenario simultaneously; and in another scenario, cold production occurs by multiplying the probability of the scenario occurring by the sum of all the scenarios.Figure 19
Production of heat and cold by EHP in a (a) load shift and (b) no load shift.
(a)(b)


#### 6.2.2. Comparison of Operating Benefit in Two Modes with and without Load Shifting

Table5 shows the benefit obtained from the optimal performance of the microgrid in two modes with and without load shifting. The benefit obtained from the operation with the load-shifting mode is increased to $727.9, which is due to the benefit of each EH. As can be seen, industrial, residential, and commercial EHs benefits are increased by $392.38, $48.41, and $218.14, respectively.Table 5
Optimal performance benefit of microgrids with and without load shifting.
Load shifting ($)No load shifting ($)Total benefit1227.26499.36Industrial EH benefit377.44-14.94Residential EH benefit287.63230.22Commercial EH benefit274.9156.77


### 6.3. Effect of IPL Application on the Microgrid Performance

In the proposed model, IPLs are considered within residential and commercial EHs. The EV presence behavior in the IPL of a residential hub is such that the EVs are charged and discharged during the night hours from 18 : 00 to 7 : 00, and the EVs presence behavior in the IPL of a commercial hub is such that the EVs are entered into the IPL uncertainly and it is possible to enter the IPL from 6 : 00 to 18 : 00. Also, the EVs that are entered the commercial IPL must be presented in the IPL for at least 2 to 8 hours during charging and discharging times.


#### 6.3.1. IPL Application Details

The battery of the EVs within the residential EH must have the same amount of energy stored when arriving and departing. The hour when the EVs arrive in the IPL, the price of electricity reaches its average peak value and will reach its peak value in the next hour. So, the EV is charged at the arrival time and discharged in the next hour, and the operating benefit will be increased. From 1 to 7 hours, the price of electricity is at a minimum level, and during these hours, EVs are regularly charged and discharged. Due to the fact that the EVs’ entrance time to the IPL in the commercial EH is at 7 o’clock in the morning, the EVs are charged at 7 and 8 o’clock when the price of electricity is low. Also, at 9 o’clock when the price of electricity reaches its average, they are discharged. Then at 10 and 11 o’clock, when the electricity price is at the average level, EVs are charged. At 12 to 14 hours, when the electricity price is at peak, EVs drain their stored energy. In the same way, they save energy at 15 to 18 due to being at the average electricity price, and at 19 and 20, due to being at the electricity peak prices, they drain the stored energy. Figure20 shows the charge and discharge rate of EVs inside the EHs.Figure 20
EV charging and discharging in (a) residential and (b) commercial EHs.
(a)(b)


#### 6.3.2. Operating Benefit in the Presence of Electric Vehicles

Table6 presents the benefits obtained from the microgrid operation in two modes of presence and absence of EVs. As can be seen, the benefit margin in the presence of EVs is $172.387. In this table, the amount of benefit of each EH in both cases is given. The reason why the industrial EH benefit has not been changed a lot is the absence of EVs in this type of EH. The benefit obtained from the operation of the residential and commercial EHs will be increased by $55.14 and $60.79, respectively.Table 6
Microgrid optimal performance benefit in the presence and absence of EVs.
Presence of EVs ($)Absence of EVs ($)Total benefit1233.1071060.72Industrial EH benefit377.3378.11Residential EH benefit289.06233.92Commercial EH benefit275.75214.96


### 6.4. The Effect of P2G System Performance on Microgrid Performance

As mentioned before, one of the most effective ways to reduce the emission of gas-fired units is to use the P2G system. P2G units using the carbon dioxide capture process are useful in reducing environmental emission. In this section, we examine the impact of the P2G system on microgrid performance.


#### 6.4.1. P2G System

Figure21 shows the amount of natural gas produced by the P2G system at different hours. In the network under study, the emission cost is estimated at 4 cents/kg, and the electricity price at nonpeak times is estimated at 3 cents/kwh; therefore, the P2G system consumes CO2 and electricity during nonpeak hours of electricity prices, i.e., 1 to 8 in the morning, 23 and 24 at night, and produces natural gas. Also, at 23 and 24 hours, the production of P2G system is more than other hours, which is due to the fact that the industrial energy boiler hub is more active during these hours than other hours, and as a result, the production of CO2 is higher. In the commercial EH, the natural gas production profile by the P2G system has a uniform shape, which is due to the uniform activity of the MT in this EH.Figure 21
Natural gas produced by the P2G system of industrial and commercial EHs.


#### 6.4.2. The Effect of P2G System Presence on Operating Benefits

The gain of optimal microgrid performance in the presence of P2G and in the absence of P2G is given in Table7, which is increased by the presence of P2G. As it is known, the benefit rate of the residential EH does not change much for the absence of P2G system in the residential EH. The benefit of industrial and commercial EHs also increased by $7.81 and $8.26 in the presence of P2G system, respectively.Table 7
Benefit from optimal microgrid performance in P2G presence and P2G absence.
Presence of P2G ($)Absence of P2G ($)Total benefit1233.1071218.79Industrial hub benefit377.3369.49Residential hub benefit289.06290.92Commercial hub benefit275.75267.9649


## 6.1. Understudy Network and Presentation of EHs

In order to plan the microgrid optimal performance, a modified IEEE 33-Bus test network has been utilized as a microgrid [39]. This microgrid consists of three types of residential, industrial, and commercial EHs. Since the supply of electricity and gas can be performed through the electricity and the natural gas distribution networks, respectively, two upstream networks are intended for this purpose. Heating and cooling requirements are met locally. The specifications of the natural gas distribution system are given in [36].The diagram of the test network with EHs and types of loads s shown in Figure7. In this understudy microgrid system, an industrial EH, two residential EHs, and a commercial EH are considered, which are located at busses numbered 16, 21, 24, and 29, respectively.Figure 7
Test grid with different types of EHs.The electrical loads on these hubs are marked with purple, pink, and yellow colors, respectively, and the loads are shown with black color. All these loads, except for gas, participate in the demand response program.In the residential EH, energy sources include the upstream electricity and gas networks and the photovoltaic system. Also, in this hub, the considered energy converters include boiler, EHP, and absorption chiller. In addition, this EH includes electrical storage, heating, and cooling, as well as IPL with a capacity of 30 electric vehicles. In the commercial EH, the sources of energy production include the upstream electricity and gas networks, and the considered energy converters include CHP, compression chiller, absorption chiller, microturbine, and P2G system. In addition, this EH includes an IPL with a capacity of 30 electric vehicles. In the industrial EH, the energy sources include the upstream electricity and gas networks and wind turbine, and the considered energy converters include boiler, CHP, compression chiller, absorption chiller, microturbine, and P2G system. In addition, this EH includes electrical, heating, and cooling storages. All three types of these EHs are required to provide electrical, heating, and cooling loads. It should be noted that the operating hours are intended for residential IPL at night and for commercial one during the day.Their components are listed in Table2. The prices of energy carriers other than natural gas, which are considered constant, as well as the information of storage systems are shown in Figure 8 and Table 3, respectively.Table 2
Components of EHs.
Industrial hubCommercial hubResidential hubUpstream power grid✓✓✓Upstream gas network✓✓✓Photovoltaic panel✗✗✓Wind turbine✓✗✗Boiler✓✗✓EHP✗✗✓Absorption chiller✓✓✓Electric chiller✓✓✗CHP✗✓✗P2G✓✓✗HRD✓✓✗Microturbine✓✓✗Battery✓✗✓Intelligent parking lots✗✓✓Cooling storage✓✗✓Heat storage✓✗✓Figure 8
Energy carrier prices (electricity, cooling, and heating).Table 3
Information storage systems.
ParameterStorage systemElectricThermalCoolingEV batteriesMinimum charge power10101010Maximum charge power40403040Minimum discharge power10101010Maximum discharge power40403040Charging efficiency0.950.920.95Discharge efficiency0.950.90.950.95Minimum energy20202015Maximum energy15015010075Initial energy20202020Loss coefficient0.010.010.010.01Replacement cost2000050005000200000Charge-discharge capacity4e64e64e64e6Table4 provides information on the components used in EHs. The loads applied to EHs vary depending on the type. Consumption profiles for different types of loads are illustrated in Figure 9. Finally, the energy production profile by wind turbine and PV units is shown in Figure 10.Table 4
Parameters of components EHs.
Boiler output heat range50-220 kwCOP absorption chiller0.75EHP heat output range20-110 kwElectric DR incentives1 cents/kWhEHP cooling output range20-110 kWThermal DR incentives0.5 cents/kWhAC cooling output range20-70 kWCooling DR incentives0.3 cents/kWhMaximum cold produced by EC560 kWParticipation coefficient for electric, thermal, and cooling DR0.2Electric power range of microturbines30-200 kWValue of lost electric load1 $/kWhMaximum heat output HR240 kWValue of lost thermal load0.5 $/kWhMaximum P2G power consumption200 kWValue of lost cooling load0.5 $/kWhThermal value of natural gas9.7 kWh/m3Transformer efficiency0.95Electrical power efficiency of micro turbines0.35PV converter efficiency0.95Microturbine heat loss rate0.1Price NG3 cents/kWhHR thermal efficiency0.75Scheduling horizon1 hEC efficiency0.95Cooling ramp down of EHP110 kW/hGas storage charge and discharge efficiency0.9Heat ramp up of EHP110 kW/hCoefficient of response of electric power to CO2/natural gas for P2G1.35/0.6 kg/kWhRamp up of boiler50 kW/hCCP carbon adsorption efficiency0.9Ramp up of chiller30 kW/hPower consumption factor for CCP0.12 kW/kgCooling ramp up of EHP40 kW/hCO2 emission intensity MT/GB0.32/0.51 kg/kWRamp down of boiler220 kW/hRamping rate MT60 kWRamp down of chiller45 kW/hMinimum on/off time for MT4 hHeat ramp down of EHP110 kW/hStart-up cost of boiler10$Number of electric vehicles30Start-up cost of EHP4$Not available time electric vehicles in the residential parking lot6-18Start-up cost of AC3$Available time electric vehicles in the commercial parking lot6-18Start-up cost of EC3$Boiler efficiency0.85Shut down cost of boiler10$COP thermal EHP3.5Shut down cost of EHP4$COP cooling EHP3.5Shut down cost of chiller4$Minimum electrical and thermal power produced by CHP0.4 MWCHP electrical efficiency0.42Maximum electrical and thermal power produced by CHP4 MWCHP thermal efficiency0.47Cost of starting and stopping CHP10$Figure 9
Load profiles (a) electrical, (b) cooling, (c) heating, and (d) natural gas for the EHs.
(a)(b)(c)(d)Figure 10
Power produced by PV and wind turbine units.


## 6.2. Planning Results in the Test System

In this subsection, the simulation results are examined under different case studies in terms of the impact of load shifting, IPLs, and P2G system employment. This approach simultaneously tries to optimize the amount of energy production and consequently save energy consumption, leading to an increase in the overall benefit of the system.


### 6.2.1. The Effect of Load Shifting on the Microgrid Performance

According to the DR programs, consumers change their electrical load from the electricity peak price to the off-peak time in order to reduce the cost of the network to meet the demand and provide the energy needed. They also transfer their cooling and heating loads from peak time to off-peak according to the load consumption profile. Following this, the operator will provide the energy at a lower price to provide the load, and in exchange, the operator will pay the consumers as a reward for this load shifting, which is less than the cost of the supply during the peak price time. Figures11–13 show the load shifting on the electrical, heating, and cooling loads of industrial, residential, and commercial EHs, respectively.Figure 11
Shifting load (a) electric, (b) heating, and (c) cooling for industrial EH.
(a)(b)(c)Figure 12
Shifting load (a) electric, (b) heating, and (c) cooling for residential EH.
(a)(b)(c)Figure 13
Shifting load (a) electric, (b) heating, and (c) cooling for commercial EH.
(a)(b)(c)(1) Power Exchanged with the Upstream Network. After the optimal use of the generation capacity inside the hubs, its surplus or shortage is exchanged with the upstream network to supply energy. Figure 14 shows the amount of electrical energy and natural gas exchanged with the upstream network in two modes with and without load shifting.Figure 14
(a) Electricity and (b) natural gas exchanged with the upstream grid.
(a)(b)By comparing the two curves shown in Figure14 in case of load shifting, it is considered that the amount of load that must be provided at the electricity peak price is shifted to off-peak time, and the amount of electricity and natural gas purchased from the upstream network is also shifted.(2) Load-Shedding. The results of the load shifting effect are determined when the load shifting is not included, since the heating and cooling loads are met locally during peak hour consumption. As the internal energy generation of the EHs will not be able to supply the demand during this time, the load-shedding occurs. In the load shifting mode using DR programs, this load value is transferred to low-load times and does not meet the load-shedding by paying a high cost. Figure 15 shows the amount of cooling load-shedding in the absence of load shifting in the network for industrial, residential, and commercial applications.Figure 15
The amount of cooling energy shedding in different types of EHs.(3) Different Component Performance of the EHs.
(i)
MicroturbineFigure16 shows the amount of electrical energy and heating produced by MTs in two modes of with and without load shifting, respectively. As can be seen, the production capacity of MTs increases at nonpeak electricity prices when load shifting is taken into account, because according to Figure 11(a), the electric charge has shifted from the peak time to the nonpeak time of the electricity price.
(ii)
BoilerFigure 16
(a) Electricity and (b) heating generations by MTs.
(a)(b)The cooling generation by the absorption chiller in the industrial EH is completely stopped at hours 17 to 24, and practically, the heat consumption is reduced during these hours. Since the heat production of the industrial EH MT is increased, and consequently, the amount of heat production by the boiler is reduced, so by increasing the energy production of the MT, its heat and electricity production actually increases at the same time. Surplus production is exchanged through the power grid. Of course, the heat generated by the boiler cannot be exchanged because the heating distribution network is not considered. Since, the heat generated by the residential EH’s boiler is used to produce the cooling by the absorption chiller, and by applying load shifting, the cooling load is reduced during peak demand times, and the thermal energy consumption is reduced by the absorption chiller for cooling production. Due to the fact that cooling and heating loads are provided locally, the excess thermal power generated cannot be sold to the upstream network; therefore, the boiler production is reduced. Figure17 shows the amount of heat generated by the industrial and residential boilers in two modes with and without load shifting.
(iii)
Absorption chillerFigure 17
The amount of heating produced by the boiler in two modes with and without load shifting for (a) industrial and (b) residential EHs.
(a)(b)As can be seen from Figure18, the amount of cooling produced by the absorption chiller has been transferred from 18 to 24 hours to 2 to 9 hours in the mode with regard to load shift compared to the mode without load shift. This is because the price of electricity is lower during these hours, and the operation of the MT can be used to generate the heat consumed by the chiller during these hours. The amount of cooling produced by the residential EH absorption chiller in the load shift mode is reduced compared to the non-shift load mode at the peak cooling consumption. This amount of reduction is transmitted to the nonpeak time via load shift and is provided by EHP. Cooling production by commercial EH absorption chiller increases in 4-8 hours. The reason for this increase is the production of more heat by the MT during these hours, which provides the heat consumed by the absorption chiller.
(iv)
EHP unitFigure 18
Production cooling of absorption chiller of EH (a) industrial, (b) residential, and (c) commercial in shift mode and without shift load.
(a)(b)(c)Due to an increase in load at nonpeak load, the cooling output of the EHP unit also increases, but its heat output decreases. Figure19 depicts the amount of heat and cold generated by the EHP; this unit has generated both heat and cold at the same time. Of course, this apparent synchronicity is due to the fact that the total output of the EHP unit in these figures is present in all scenarios, and it is possible for the EHP unit to generate heat from one scenario simultaneously; and in another scenario, cold production occurs by multiplying the probability of the scenario occurring by the sum of all the scenarios.Figure 19
Production of heat and cold by EHP in a (a) load shift and (b) no load shift.
(a)(b)


### 6.2.2. Comparison of Operating Benefit in Two Modes with and without Load Shifting

Table5 shows the benefit obtained from the optimal performance of the microgrid in two modes with and without load shifting. The benefit obtained from the operation with the load-shifting mode is increased to $727.9, which is due to the benefit of each EH. As can be seen, industrial, residential, and commercial EHs benefits are increased by $392.38, $48.41, and $218.14, respectively.Table 5
Optimal performance benefit of microgrids with and without load shifting.
Load shifting ($)No load shifting ($)Total benefit1227.26499.36Industrial EH benefit377.44-14.94Residential EH benefit287.63230.22Commercial EH benefit274.9156.77


## 6.2.1. The Effect of Load Shifting on the Microgrid Performance

According to the DR programs, consumers change their electrical load from the electricity peak price to the off-peak time in order to reduce the cost of the network to meet the demand and provide the energy needed. They also transfer their cooling and heating loads from peak time to off-peak according to the load consumption profile. Following this, the operator will provide the energy at a lower price to provide the load, and in exchange, the operator will pay the consumers as a reward for this load shifting, which is less than the cost of the supply during the peak price time. Figures11–13 show the load shifting on the electrical, heating, and cooling loads of industrial, residential, and commercial EHs, respectively.Figure 11
Shifting load (a) electric, (b) heating, and (c) cooling for industrial EH.
(a)(b)(c)Figure 12
Shifting load (a) electric, (b) heating, and (c) cooling for residential EH.
(a)(b)(c)Figure 13
Shifting load (a) electric, (b) heating, and (c) cooling for commercial EH.
(a)(b)(c)(1) Power Exchanged with the Upstream Network. After the optimal use of the generation capacity inside the hubs, its surplus or shortage is exchanged with the upstream network to supply energy. Figure 14 shows the amount of electrical energy and natural gas exchanged with the upstream network in two modes with and without load shifting.Figure 14
(a) Electricity and (b) natural gas exchanged with the upstream grid.
(a)(b)By comparing the two curves shown in Figure14 in case of load shifting, it is considered that the amount of load that must be provided at the electricity peak price is shifted to off-peak time, and the amount of electricity and natural gas purchased from the upstream network is also shifted.(2) Load-Shedding. The results of the load shifting effect are determined when the load shifting is not included, since the heating and cooling loads are met locally during peak hour consumption. As the internal energy generation of the EHs will not be able to supply the demand during this time, the load-shedding occurs. In the load shifting mode using DR programs, this load value is transferred to low-load times and does not meet the load-shedding by paying a high cost. Figure 15 shows the amount of cooling load-shedding in the absence of load shifting in the network for industrial, residential, and commercial applications.Figure 15
The amount of cooling energy shedding in different types of EHs.(3) Different Component Performance of the EHs.
(i)
MicroturbineFigure16 shows the amount of electrical energy and heating produced by MTs in two modes of with and without load shifting, respectively. As can be seen, the production capacity of MTs increases at nonpeak electricity prices when load shifting is taken into account, because according to Figure 11(a), the electric charge has shifted from the peak time to the nonpeak time of the electricity price.
(ii)
BoilerFigure 16
(a) Electricity and (b) heating generations by MTs.
(a)(b)The cooling generation by the absorption chiller in the industrial EH is completely stopped at hours 17 to 24, and practically, the heat consumption is reduced during these hours. Since the heat production of the industrial EH MT is increased, and consequently, the amount of heat production by the boiler is reduced, so by increasing the energy production of the MT, its heat and electricity production actually increases at the same time. Surplus production is exchanged through the power grid. Of course, the heat generated by the boiler cannot be exchanged because the heating distribution network is not considered. Since, the heat generated by the residential EH’s boiler is used to produce the cooling by the absorption chiller, and by applying load shifting, the cooling load is reduced during peak demand times, and the thermal energy consumption is reduced by the absorption chiller for cooling production. Due to the fact that cooling and heating loads are provided locally, the excess thermal power generated cannot be sold to the upstream network; therefore, the boiler production is reduced. Figure17 shows the amount of heat generated by the industrial and residential boilers in two modes with and without load shifting.
(iii)
Absorption chillerFigure 17
The amount of heating produced by the boiler in two modes with and without load shifting for (a) industrial and (b) residential EHs.
(a)(b)As can be seen from Figure18, the amount of cooling produced by the absorption chiller has been transferred from 18 to 24 hours to 2 to 9 hours in the mode with regard to load shift compared to the mode without load shift. This is because the price of electricity is lower during these hours, and the operation of the MT can be used to generate the heat consumed by the chiller during these hours. The amount of cooling produced by the residential EH absorption chiller in the load shift mode is reduced compared to the non-shift load mode at the peak cooling consumption. This amount of reduction is transmitted to the nonpeak time via load shift and is provided by EHP. Cooling production by commercial EH absorption chiller increases in 4-8 hours. The reason for this increase is the production of more heat by the MT during these hours, which provides the heat consumed by the absorption chiller.
(iv)
EHP unitFigure 18
Production cooling of absorption chiller of EH (a) industrial, (b) residential, and (c) commercial in shift mode and without shift load.
(a)(b)(c)Due to an increase in load at nonpeak load, the cooling output of the EHP unit also increases, but its heat output decreases. Figure19 depicts the amount of heat and cold generated by the EHP; this unit has generated both heat and cold at the same time. Of course, this apparent synchronicity is due to the fact that the total output of the EHP unit in these figures is present in all scenarios, and it is possible for the EHP unit to generate heat from one scenario simultaneously; and in another scenario, cold production occurs by multiplying the probability of the scenario occurring by the sum of all the scenarios.Figure 19
Production of heat and cold by EHP in a (a) load shift and (b) no load shift.
(a)(b)


## 6.2.2. Comparison of Operating Benefit in Two Modes with and without Load Shifting

Table5 shows the benefit obtained from the optimal performance of the microgrid in two modes with and without load shifting. The benefit obtained from the operation with the load-shifting mode is increased to $727.9, which is due to the benefit of each EH. As can be seen, industrial, residential, and commercial EHs benefits are increased by $392.38, $48.41, and $218.14, respectively.Table 5
Optimal performance benefit of microgrids with and without load shifting.
Load shifting ($)No load shifting ($)Total benefit1227.26499.36Industrial EH benefit377.44-14.94Residential EH benefit287.63230.22Commercial EH benefit274.9156.77


## 6.3. Effect of IPL Application on the Microgrid Performance

In the proposed model, IPLs are considered within residential and commercial EHs. The EV presence behavior in the IPL of a residential hub is such that the EVs are charged and discharged during the night hours from 18 : 00 to 7 : 00, and the EVs presence behavior in the IPL of a commercial hub is such that the EVs are entered into the IPL uncertainly and it is possible to enter the IPL from 6 : 00 to 18 : 00. Also, the EVs that are entered the commercial IPL must be presented in the IPL for at least 2 to 8 hours during charging and discharging times.


### 6.3.1. IPL Application Details

The battery of the EVs within the residential EH must have the same amount of energy stored when arriving and departing. The hour when the EVs arrive in the IPL, the price of electricity reaches its average peak value and will reach its peak value in the next hour. So, the EV is charged at the arrival time and discharged in the next hour, and the operating benefit will be increased. From 1 to 7 hours, the price of electricity is at a minimum level, and during these hours, EVs are regularly charged and discharged. Due to the fact that the EVs’ entrance time to the IPL in the commercial EH is at 7 o’clock in the morning, the EVs are charged at 7 and 8 o’clock when the price of electricity is low. Also, at 9 o’clock when the price of electricity reaches its average, they are discharged. Then at 10 and 11 o’clock, when the electricity price is at the average level, EVs are charged. At 12 to 14 hours, when the electricity price is at peak, EVs drain their stored energy. In the same way, they save energy at 15 to 18 due to being at the average electricity price, and at 19 and 20, due to being at the electricity peak prices, they drain the stored energy. Figure20 shows the charge and discharge rate of EVs inside the EHs.Figure 20
EV charging and discharging in (a) residential and (b) commercial EHs.
(a)(b)


### 6.3.2. Operating Benefit in the Presence of Electric Vehicles

Table6 presents the benefits obtained from the microgrid operation in two modes of presence and absence of EVs. As can be seen, the benefit margin in the presence of EVs is $172.387. In this table, the amount of benefit of each EH in both cases is given. The reason why the industrial EH benefit has not been changed a lot is the absence of EVs in this type of EH. The benefit obtained from the operation of the residential and commercial EHs will be increased by $55.14 and $60.79, respectively.Table 6
Microgrid optimal performance benefit in the presence and absence of EVs.
Presence of EVs ($)Absence of EVs ($)Total benefit1233.1071060.72Industrial EH benefit377.3378.11Residential EH benefit289.06233.92Commercial EH benefit275.75214.96


## 6.3.1. IPL Application Details

The battery of the EVs within the residential EH must have the same amount of energy stored when arriving and departing. The hour when the EVs arrive in the IPL, the price of electricity reaches its average peak value and will reach its peak value in the next hour. So, the EV is charged at the arrival time and discharged in the next hour, and the operating benefit will be increased. From 1 to 7 hours, the price of electricity is at a minimum level, and during these hours, EVs are regularly charged and discharged. Due to the fact that the EVs’ entrance time to the IPL in the commercial EH is at 7 o’clock in the morning, the EVs are charged at 7 and 8 o’clock when the price of electricity is low. Also, at 9 o’clock when the price of electricity reaches its average, they are discharged. Then at 10 and 11 o’clock, when the electricity price is at the average level, EVs are charged. At 12 to 14 hours, when the electricity price is at peak, EVs drain their stored energy. In the same way, they save energy at 15 to 18 due to being at the average electricity price, and at 19 and 20, due to being at the electricity peak prices, they drain the stored energy. Figure20 shows the charge and discharge rate of EVs inside the EHs.Figure 20
EV charging and discharging in (a) residential and (b) commercial EHs.
(a)(b)


## 6.3.2. Operating Benefit in the Presence of Electric Vehicles

Table6 presents the benefits obtained from the microgrid operation in two modes of presence and absence of EVs. As can be seen, the benefit margin in the presence of EVs is $172.387. In this table, the amount of benefit of each EH in both cases is given. The reason why the industrial EH benefit has not been changed a lot is the absence of EVs in this type of EH. The benefit obtained from the operation of the residential and commercial EHs will be increased by $55.14 and $60.79, respectively.Table 6
Microgrid optimal performance benefit in the presence and absence of EVs.
Presence of EVs ($)Absence of EVs ($)Total benefit1233.1071060.72Industrial EH benefit377.3378.11Residential EH benefit289.06233.92Commercial EH benefit275.75214.96


## 6.4. The Effect of P2G System Performance on Microgrid Performance

As mentioned before, one of the most effective ways to reduce the emission of gas-fired units is to use the P2G system. P2G units using the carbon dioxide capture process are useful in reducing environmental emission. In this section, we examine the impact of the P2G system on microgrid performance.


### 6.4.1. P2G System

Figure21 shows the amount of natural gas produced by the P2G system at different hours. In the network under study, the emission cost is estimated at 4 cents/kg, and the electricity price at nonpeak times is estimated at 3 cents/kwh; therefore, the P2G system consumes CO2 and electricity during nonpeak hours of electricity prices, i.e., 1 to 8 in the morning, 23 and 24 at night, and produces natural gas. Also, at 23 and 24 hours, the production of P2G system is more than other hours, which is due to the fact that the industrial energy boiler hub is more active during these hours than other hours, and as a result, the production of CO2 is higher. In the commercial EH, the natural gas production profile by the P2G system has a uniform shape, which is due to the uniform activity of the MT in this EH.Figure 21
Natural gas produced by the P2G system of industrial and commercial EHs.


### 6.4.2. The Effect of P2G System Presence on Operating Benefits

The gain of optimal microgrid performance in the presence of P2G and in the absence of P2G is given in Table7, which is increased by the presence of P2G. As it is known, the benefit rate of the residential EH does not change much for the absence of P2G system in the residential EH. The benefit of industrial and commercial EHs also increased by $7.81 and $8.26 in the presence of P2G system, respectively.Table 7
Benefit from optimal microgrid performance in P2G presence and P2G absence.
Presence of P2G ($)Absence of P2G ($)Total benefit1233.1071218.79Industrial hub benefit377.3369.49Residential hub benefit289.06290.92Commercial hub benefit275.75267.9649


## 6.4.1. P2G System

Figure21 shows the amount of natural gas produced by the P2G system at different hours. In the network under study, the emission cost is estimated at 4 cents/kg, and the electricity price at nonpeak times is estimated at 3 cents/kwh; therefore, the P2G system consumes CO2 and electricity during nonpeak hours of electricity prices, i.e., 1 to 8 in the morning, 23 and 24 at night, and produces natural gas. Also, at 23 and 24 hours, the production of P2G system is more than other hours, which is due to the fact that the industrial energy boiler hub is more active during these hours than other hours, and as a result, the production of CO2 is higher. In the commercial EH, the natural gas production profile by the P2G system has a uniform shape, which is due to the uniform activity of the MT in this EH.Figure 21
Natural gas produced by the P2G system of industrial and commercial EHs.


## 6.4.2. The Effect of P2G System Presence on Operating Benefits

The gain of optimal microgrid performance in the presence of P2G and in the absence of P2G is given in Table7, which is increased by the presence of P2G. As it is known, the benefit rate of the residential EH does not change much for the absence of P2G system in the residential EH. The benefit of industrial and commercial EHs also increased by $7.81 and $8.26 in the presence of P2G system, respectively.Table 7
Benefit from optimal microgrid performance in P2G presence and P2G absence.
Presence of P2G ($)Absence of P2G ($)Total benefit1233.1071218.79Industrial hub benefit377.3369.49Residential hub benefit289.06290.92Commercial hub benefit275.75267.9649


## 7. Conclusion

In this paper, the economic planning model of distributed energy resources along with the use of EVs and P2G system is proposed to reduce environmental emission in different types of EHs with different types of loads. In the proposed procedure, a microgrid is first modeled with different types of EHs. Then, the effect of different types of load shifting on the microgrid operation and economic dispatch of resources is investigated. In addition, the effect of EVs and P2G system on the emission cost of gas-fired unit performance is analyzed.Based on the proposed process, a comprehensive concept of employing the EH complex has been considered, and the effect of various factors such as load shift, IPL unit, and P2G system within this complex has been studied.The implementation of the proposed approach on IEEE 33-Bus test network shows that the load-shifting DR programs are used to meet consumer energy demand per hour of day, especially during peak hours of energy consumption. Load shifting gives a significant effect on increasing the benefit obtained from the EH operation. Also, it improves the optimal performance of the EHs internal resources in such a way that other units do not need to increase the activity during peak hours; this amount of generation is transferred to off-peak hours. IPL for clean energy is one of the most effective and efficient topics. The EVs in these IPLs reduce emission to meet the demand for electricity due to the way they are charged and discharged. The latest technology in the field of clean energy is the P2G system. This technology reduces environmental emission in the microgrid by consuming electrical energy and converting CO2 produced by gas-fired units to natural gas and preventing further CO2 emissions. Simultaneous use of these three items increases the profitability of the whole system as well as the economic distribution of energy carriers.



---

*Source: 3173099-2023-02-04.xml*