Keywords

5.1 Introduction

The gradual decrease in fossil fuels as one of the most important sources of energy production as well as the environmental pollution problem has created many concerns in the world so that many international treaties (i.e., Paris Treaty) have signed [1]. These issues have caused to increase the attention to the subject of energy management and environmental protection at the international level [2]. Currently, energy resources such as electricity and natural gas networks are independently managed and operated that these matters cause to reduce energy efficiency and as a result, reduce the reliability in energy supply, increase the operating costs and excessive pollution. Energy consumers need different energy carriers to meet their living needs, but the most important energy carriers used by the consumers are natural gas and electricity because they are easy to operate and also many appliances depend on electricity and natural gas.

In conventional systems these needs are provided independently, that is, natural gas and electricity are supplied to consumers individually. However, with the advancement of the technology of combined heat and power (CHP) generation systems as an effective factor in the supply of natural gas and electricity, in addition to the gas needs of the consumers, they can simultaneously meet their thermal and electrical requirements. CHP systems can have an efficiency of between 60 and 80% which will increase the efficiency of energy supply [3]. On the other hand, combined cycle power plants with more than 60% efficiency, which are economically viable, have been able to conquer the power market. With the growth of global energy consumption and the environmental impacts of fossil fuels used in conventional power plants, the tendency to use renewable sources has increased. In addition, natural gas plays an important role in the global energy market by producing electricity in large scale namely in gas-fired power plants and in small scale in CHP systems. As a result, combining different sources of energy from renewable sources to natural gas in one set can facilitate the achievement of a sustainable energy network [4].

Since natural gas and electricity are interconnected, the operation of integrated energy systems increases the efficiency of the supply of energy to customers who need natural gas and electricity and heat. But since one of the most important issues regarding energy supply is economic subject, in order to improve consumer comfort and reduce government spending, we will try to minimize the cost of operation, namely to purchase natural gas and electricity. Another important issue in supplying energy is the matter of air pollution, which must be carefully investigated. To this end, we need to determine how much and when to use the source of energy to minimize operating costs, for example, it should be determined when the storage will be charged or discharged, or how much renewable resource production per hour is, and the rest of the resources and equipment are similarly. In the direction of optimizing utilization costs, we are faced with the uncertainty of renewable resources. The production capacity of wind turbines and solar panels is uncertain, since power generation by wind turbines and solar panels depends on the speed of wind and the amount of sunlight, respectively, and this makes it impossible for us to accurately describe the generation of electricity by these sources. Although the wind and sunlight are predictable, it cannot be commented on precisely and definitively, and this affects the process of modeling and simulation of the problem. On the other hand, there are several methods, including scenario production, for modeling uncertainties that we use to model the uncertainty of the output of renewable resources and consider these uncertainties in the optimization problem. On the other hand, there are constraints and limitations that will add to the optimization problem. Among these constraints are the limited capacity of gas pipelines and power lines, the limitation of wind turbine and solar cells production, and the storage capacity limitations.

The need for energy is one of the most fundamental human needs, so that without energy resources, such as electricity and natural gas, human life will be impossible. Regarding the gradual completion of fossil fuels, including natural gas, and the dependence of electricity generation on natural gas in gas-fired units and the problem of air pollution, energy management becomes increasingly important. Utilization of energy resources (gas and electricity), in addition to reducing energy efficiency, will result in excessive consumption of these resources, which will have economic consequences. The simultaneous operation of energy resources can prevent the above problems, because if we know what kind of energy source and when and how much must be used, we can manage energy resources and solve economic problems caused by excess energy consumption. On the other hand, greenhouse gas emissions and increased energy needs will lead us to utilize new sources and technologies. New technologies, such as CHP systems, have made possible the operation of energy resources with high profits. Reducing greenhouse gas emissions, improving reliability and efficient operation, have been considered as the advantages of combining different energy networks [5].

In this section, we will investigate the research on energy hubs. With the advancement of technology, the issue of energy management has been given particular attention. Considerable research has been done on energy management in the form of energy hub in various aspects. Some of the research related to energy hub done are the reduction of operating costs [5, 6], reduction of air pollution [7, 8] and increase in profits due to the sale of energy in the market [9, 10]. Among the technologies used in the energy hub, renewable sources are one of the most important equipment, because they cause to reduce the dependence of the energy hub on the grid and increase the reliability of energy supply and also decrease air pollution [11]. In some studies, the output of renewable resources has been deterministically modeled [12, 13], and in some other research outputs of these resources have been modeled uncertainly [13, 14]. Electric vehicle [15, 16] is one of the other technologies that has attracted particular attention to the fact that, in addition to reducing air pollution, it delivers its stored energy to energy hub at peak time. One of the most important equipment used in energy hub is energy storage [17, 18], which plays a key role in energy management by storing energy at off-peak times and delivering energy stored at peak hours. Another important equipment is CHP systems [19, 20], which produces electricity and heat from natural gas to meet part of the needs of consumers in the energy hub.

In short, the contributions of this chapter are as follows:

  • A novel cost-emission based modeling for energy management in residential sectors

  • Utilizing various equipment such as renewable resources and co-generation devices to reduce the cost of operation and air pollution

  • Considering responsible loads to investigate the effect of the demand response program

  • Formulating the model as a mixed-integer linear programming

The remainder of this chapter is organized as follows: In Sect. 5.2, the concept of the energy hub and its general structure are expressed. Mathematical modeling and problem formulation of the proposed scheme is shown in Sect. 5.3. In Sect. 5.4, simulation results are presented and discussed. Finally, in Sect. 5.5, the conclusions of this chapter are given.

5.2 Energy Hub

Today energy plays an indelible role in the development of human societies. Especially the electrical energy that can easily change into different forms of energy and eliminate the needs of consumers. Recently, the concept of energy hub [21, 22] has been proposed for the use of integrated energy systems. The energy hub is a super node that receives different energy carriers at its input, and then determines which technology and energy carrier to meet the needs of the subscriber according to planning [5]. In a typical energy hub, its entrances are natural gas and electricity, and its outputs are electricity and heat. Structure of the energy hub is composed of different equipment such as a CHP system for generating electricity and heat from natural gas, a transformer for converting electrical voltage levels, an electric heater for generating heat from electricity and energy storages for storing electricity and heat. Subscribers who feed on energy hub can be residential, industrial, and commercial consumers. The energy hub supplies its consumers and sells its energy surplus to the grid. Figure 5.1 shows the general model of an energy hub. As you can see, the electrical energy is converted to an acceptable voltage level by the transformer after entering the energy hub, and then a part of it has been given to consumers and the other part is stored and its surplus is sold to the network. Natural gas after converting to the heat and electricity is given to consumers.

Fig. 5.1
figure 1

Overview of energy hub

5.3 Problem Formulation

In this section, a residential building is considered as an energy hub whose general structure is shown in Fig. 5.2. Various and sometimes conflicting issues, such as system reliability, environmental protection, profitability, comfortable life, and economic should be considered in optimal utilization of residential energy hub [23]. The proposed energy hub for a smart home receives two energy carriers, including natural gas and electricity, at its entrances. The energy hub is also composed of various equipment and tools including solar panels, power, and heat storage units and a CHP system to meet the needs of its consumers, which require heat and power. The consumers connected to the smart energy hub divide into two categories. The first type is uncontrollable loads that have an invariable profile, and the second category is controllable loads that have specific energy consumption and the operating time of these loads is controllable. The electricity loads are supplied by the electricity purchased from the grid, electricity generated by the CHP unit, solar panels, and battery. The heat loads are fed by the boiler, the heat storage, and thermal energy generated by the CHP unit.

Fig. 5.2
figure 2

The proposed residential energy hub

Air pollution today is one of the most serious global concerns that should to be addressed seriously and the most important way to prevent its release is to reduce greenhouse gas emissions from fossil fuels. One of the important tasks that can be done to increase the efficiency of the energy hub and thereby reduce air pollution and reduce operating costs in residential buildings is the management of controllable loads [24]. In other words, it can reduce operating costs and air pollution by shifting the use of controllable loads from peak hours to off-peak hours, and the energy hub can sell its energy surplus at peak time to the grid and thereby earn money for itself and play a role in reducing air pollution. For this purpose, in the energy hub, the Internet of Things technology has been used. In this method, as shown in Fig. 5.3, inputs and loads, as well as the performance status of the equipment, are measured by the sensors, and their information is delivered to the central smart controller. The central controller also receives electricity and gas prices from the electricity and gas market, and then, based on the proposed energy management plan, optimizes energy consumption.

Fig. 5.3
figure 3

Model of the proposed residential energy hub control

5.3.1 Component Modelling

In this section, introducing and modeling the components of the energy hub and the objective function in the form of mathematical formulas are discussed to be used in the optimization problem.

5.3.1.1 Energy Storage

Nowadays, due to the rise in the price of energy carriers and the sharp fluctuation of energy prices in the spot market, the use of storage in the energy sector has increased significantly. On the other hand, electrical storages also increase the use of renewable resources, as fluctuations in the production of these resources are controlled, which increases the quality of the system, reduces energy costs, and increases system profits [25]. Therefore, energy storage units are one of the most important and most profitable parts of the energy hub [26, 27]. Energy storage has been considered for economic benefit and reliability. Using energy storage units in energy hubs helps greatly reduce the cost of purchasing energy because they can be charged at low energy costs and supply consumers when energy is high. In the proposed model of this chapter, electric and thermal storage devices are used, and their mathematical equations are as follows.

5.3.1.1.1 Battery Energy Storage

As stated, the storage device is charged at low energy cost hours and discharged at high energy cost hours to feed local loads [28]. In this section, the mathematical equations of the electric storage are shown, which shows the state of charge of the battery in Eq. (5.1). Equation (5.2) shows the minimum and maximum storage capacity. Equation (5.3) emphasizes that the energy stored in the battery at hour 24 is equal to its initial energy value. Equations (5.4) and (5.5) show the maximum charge and discharge power of the storage device. Equation (5.6) also prevents charging and discharging battery simultaneously.

$$ {E}_{\mathrm{es}}^t={E}_{\mathrm{es}}^0+\sum \limits_{h=1}^t\left({\eta}_{\mathrm{es},\mathrm{ch}}{P}_{\mathrm{es},\mathrm{ch}}^h-\frac{P_{\mathrm{es},\mathrm{dch}}^h}{\eta_{\mathrm{es},\mathrm{dch}}}\right) \vspace*{-10pt}$$
(5.1)
$$ {E}_{\mathrm{es}}^{\mathrm{min}}\le {E}_{\mathrm{es}}^t\le {E}_{\mathrm{es}}^{\mathrm{max}} \vspace*{-10pt}$$
(5.2)
$$ {E}_{\mathrm{es}}^{24}={E}_{\mathrm{es}}^0 \vspace*{-10pt}$$
(5.3)
$$ 0\le {P}_{\mathrm{es},\mathrm{ch}}^t\le {P}_{\mathrm{es},\mathrm{ch}}^{\mathrm{max}}{l}_{\mathrm{es},\mathrm{ch}}^t \vspace*{-10pt}$$
(5.4)
$$ 0\le {P}_{\mathrm{es},\mathrm{dch}}^t\le {P}_{\mathrm{es},\mathrm{dch}}^{\mathrm{max}}{l}_{\mathrm{es},\mathrm{dch}}^t \vspace*{-10pt}$$
(5.5)
$$ 0\le {l}_{\mathrm{es},\mathrm{ch}}^t+{l}_{\mathrm{es},\mathrm{dch}}^t\le 1 $$
(5.6)
5.3.1.1.2 Heat Storage

Heat storage is another storage device used in this modeling that stores thermal energy and, if necessary, provides it to consumers. In this section, the mathematical modeling of heat storage is shown. Equation (5.7) shows the state of charge. Equation (5.8) indicates the minimum and maximum storage capacity. Equation (5.9) emphasizes that the energy stored in the heat storage at hour 24 is equal to its initial energy value. Equations (5.10) and (5.11) show the maximum charge and discharge power of the storage device. Equation (5.12) also prevents charging and discharging the storage simultaneously.

$$ {E}_{\mathrm{es}}^t={E}_{\mathrm{es}}^0+\sum \limits_{h=1}^t\left({\eta}_{\mathrm{es},\mathrm{ch}}{P}_{\mathrm{es},\mathrm{ch}}^h-\frac{P_{\mathrm{es},\mathrm{dch}}^h}{\eta_{\mathrm{es},\mathrm{dch}}}\right) \vspace*{-10pt}$$
(5.7)
$$ {E}_{\mathrm{es}}^{\mathrm{min}}\le {E}_{\mathrm{es}}^t\le {E}_{\mathrm{es}}^{\mathrm{max}} \vspace*{-10pt}$$
(5.8)
$$ {E}_{\mathrm{es}}^{24}={E}_{\mathrm{es}}^0 \vspace*{-10pt}$$
(5.9)
$$ 0\le {P}_{\mathrm{es},\mathrm{ch}}^t\le {P}_{\mathrm{es},\mathrm{ch}}^{\mathrm{max}}{l}_{\mathrm{es},\mathrm{ch}}^t \vspace*{-10pt}$$
(5.10)
$$ 0\le {P}_{\mathrm{es},\mathrm{dch}}^t\le {P}_{\mathrm{es},\mathrm{dch}}^{\mathrm{max}}{l}_{\mathrm{es},\mathrm{dch}}^t \vspace*{-10pt}$$
(5.11)
$$ 0\le {l}_{\mathrm{es},\mathrm{ch}}^t+{l}_{\mathrm{es},\mathrm{dch}}^t\le 1 \vspace*{-10pt}$$
(5.12)

5.3.1.2 CHP Unit

CHP unit is one of the most important technologies used in energy hub. This unit receives natural gas at its input and generates electricity and heat. This device, which is the most important factor in the connection between natural gas and electricity, has been considered for high efficiency. The CHP unit has a feasible region for operating as shown in Fig. 5.4. Electricity and heat generation by CHP depend on each other, which means that it generates a certain amount of electricity for a certain amount of heat production. The mathematical equations for CHP unit are shown in Eqs. (5.13)–(5.15).

Fig. 5.4
figure 4

Feasible region of CHP unit

$$ {P}_{\mathrm{CHP}}^t={\eta}_{\mathrm{CHP},\mathrm{e}}{\alpha}_t{G}_{\mathrm{Net}}^t \vspace*{-12pt}$$
(5.13)
$$ {H}_{\mathrm{CHP}}^t={\eta}_{\mathrm{CHP},\mathrm{h}}{\alpha}_t{G}_{\mathrm{Net}}^t \vspace*{-12pt}$$
(5.14)
$$ {\alpha}_t{G}_{\mathrm{Net}}^t\le {C}_{\mathrm{CHP}}^{\mathrm{max}} $$
(5.15)

Equations (5.13) and (5.14), respectively, represent the electrical and thermal power generated by the CHP unit, and Eq. (5.15) denotes the input of natural gas to the CHP unit for the production of electricity and heat.

$$ {P}_{\mathrm{CHP}}^t-{P}_A-\frac{P_A-{P}_B}{H_A-{H}_B}\left({H}_{\mathrm{CHP}}^t-{H}_A\right)\le 0 $$
(5.16)
$$ {P}_{\mathrm{CHP}}^t-{P}_B-\frac{P_B-{P}_C}{H_B-{H}_C}\left({H}_{\mathrm{CHP}}^t-{H}_B\right)\ge 0 $$
(5.17)
$$ {P}_{\mathrm{CHP}}^t-{P}_C-\frac{P_C-{P}_D}{H_C-{H}_D}\left({H}_{\mathrm{CHP}}^t-{H}_C\right)\ge 0 $$
(5.18)

Equations (5.16)–(5.18) show the feasible region of the CHP. According to the equations, the CHP can generate power and heat within the feasible region.

5.3.1.3 Solar Panel

Today, due to air pollution, the trend toward the use of clean and renewable resources has increased. One of these sources is the Solar Panels, which have attracted special attention in recent years, because they are easy to install and use and also generate electricity without contamination. It should be noted that the amount of electricity produced by solar panels depends on the amount of sunlight [29] whose mathematical relationships are as follows.

$$ {T}_{cy}={T}_A+{s}_{ay}\left(\frac{N_{\mathrm{OT}}-20}{0.8}\right) \vspace*{-10pt}$$
(5.19)
$$ \left.{I}_y={s}_{ay}\Big({I}_{\mathrm{sc}}+{K}_i\left({T}_c-25\right)\right) \vspace*{-10pt}$$
(5.20)
$$ {V}_y={V}_{\mathrm{oc}}-{K}_v{T}_{cy} \vspace*{-10pt}$$
(5.21)
$$ {P}_{sy}\left({s}_{ay}\right)=N. FF.{V}_y.{I}_y \vspace*{-10pt}$$
(5.22)
$$ FF=\frac{V_{\mathrm{MPP}}{I}_{\mathrm{MPP}}}{V_{\mathrm{oc}}{I}_{\mathrm{sc}}} $$
(5.23)

As it was said, the output of renewable resources is uncertain. In this modelling, the normal distribution function is used to generate scenarios for the output of solar panels, the equation of which is given from Eq. (5.24) [23].

$$ f(s)=\frac{1}{\sqrt{2\pi}\sigma }{\mathrm{e}}^{-\frac{{\left(s-\mu \right)}^2}{2{\sigma}^2}} $$
(5.24)

5.3.1.4 Load Modelling

Recently, consumer demand management systems have attracted much attention, especially in smart cities, as an effective tool for optimizing demand management at peak time [30]. In fact, demand management programs aim at changing consumption pattern to reduce costs and increase system reliability, which encourages consumers to use their programs and activities to optimize their consumption [31]. This can be a great benefit for consumers in terms of lower costs and better energy consumption control. In this modeling, loads are divided into two categories of electrical loads and thermal loads, each of which consists of two groups of controllable loads and uncontrollable loads. In other words, some of the electrical and thermal loads have a certain amount and time of consumption that cannot be controlled. On the other hand, some other loads have a certain amount of consumption that cannot be controlled, but their operating time can be controlled, and they can be shifted from peak time to off-peak time. The modeling of controllable loads is as follows.

5.3.1.4.1 Electrical Loads

Using demand-side management programs, consumers shift their consumption from peak hours that the cost of electricity is high to off-peak hours to reduce operating costs. Modeling of electric loads is as follows.

$$ {P}_{\mathrm{e}}^t={P}_{\mathrm{uc},\mathrm{e}}^t+{P}_{\mathrm{c},\mathrm{e}}^t \vspace*{-12pt}$$
(5.25)
$$ {P}_{\min, \mathrm{e}}^t\le {P}_{\mathrm{c},\mathrm{e}}^t\le {P}_{\max, \mathrm{e}}^t \vspace*{-12pt}$$
(5.26)
$$ \sum \limits_{t=1}^{24}{P}_{\mathrm{c},\mathrm{e}}^t={E}_{\mathrm{c},\mathrm{e}} $$
(5.27)

Equation (5.25) denotes that the electric loads of the system consist of controllable and uncontrollable loads. Equation (5.26) shows the minimum and maximum amount of consumable power for the electric loads. Equation (5.27) also states that the total controllable load power in 24 h is equal to the total energy consumed by these devices.

5.3.1.4.2 Heat Storage

In this modeling, demand-side management program is also used for controllable heat loads, which is modeled as follows.

$$ {P}_{\mathrm{h}}^t={P}_{\mathrm{uc},\mathrm{h}}^t+{P}_{\mathrm{c},\mathrm{h}}^t \vspace*{-12pt}$$
(5.28)
$$ {P}_{\min, \mathrm{h}}^t\le {P}_{\mathrm{c},\mathrm{h}}^t\le {P}_{\max, \mathrm{h}}^t\vspace*{-12pt} $$
(5.29)
$$ \sum \limits_{t=1}^{24}{P}_{\mathrm{c},\mathrm{h}}^t={E}_{\mathrm{c},\mathrm{h}} $$
(5.30)

Equation (5.28) denotes that the thermal loads of the system consist of controllable and uncontrollable loads. Equation (5.29) shows the minimum and maximum amount of consumable power for the thermal loads. Equation (5.30) also states that the total controllable loads power in 24 h is equal to the total energy consumed by these devices.

5.3.1.5 Uncertainty Modeling

Engineering modeling always is accompanied by uncertainties. There are a lot of methods such as scenario generation, robust optimization to model uncertainties. In this chapter, the scenario generation method has been applied to meet the renewable resource uncertainty. In this method at the first, numerous scenarios have been generated from probability density functions, and then the scenario reduction method has been applied to decrease the number of the scenarios. In the end, one of the scenarios that has the greatest probability value has been chosen as the expected scenario. The mathematical formulas for scenario generation and reduction are as follows:

$$ {\phi}_{WS}=\left\{\left({WS}^1,{\psi}_{WS}^1\right),\Big({WS}^2,{\psi}_{WS}^2\Big),\dots, \Big({WS}^n,{\psi}_{WS}^n\Big)\right\}\vspace*{-12pt} $$
(5.31)
$$ S=\prod \limits_{WS}{\phi}_{WS}\vspace*{-12pt} $$
(5.32)
$$ \sum \limits_{s\in S}{\psi}_{WS}=1 $$
(5.33)

In this chapter, Normal PDF has been applied to the scenario generation for the PV output at each hour. Equation (5.31) indicates the number of the scenarios and their probability. Equation (5.32) shows the set of the scenarios. Equation (5.33) expresses that the sum of the probabilities must equal to 1.

After generating the scenarios, the scenario reduction method is utilized in order to decrease the burden of calculations. The mathematical formulas of the scenario reduction method are as follows:

$$ {S}_1=\arg \left[\underset{s^{\prime}\in S}{\operatorname{Min}}\;\sum \limits_{s\in S}{\psi}^SW\left(S,{S}^{\prime}\right)\;\right]S=\left\{{S}_1\right\} \vspace*{-12pt}$$
(5.34)
$$ {S}_n=\arg \left[\underset{s^{\prime}\in S}{\operatorname{Min}}\;\sum \limits_{s\in S}{\psi}^S\kern0.24em \underset{s^{{\prime\prime}}\in S}{\operatorname{Min}}\kern0.24em W\left(S,{S}^{{\prime\prime}}\right)\;\right] $$
(5.35)

5.3.1.6 Heat and Power Balance

The balance of power and heat is the most important constraint in this model, which indicates that the amount of generated power and heat must be equal to the demands. According to Fig. 5.2, the equations of power and heat are written as follows:

$$ {P}_{\mathrm{net}}^t+{P}_{PV}^t+{\alpha}_t{P}_{\mathrm{CHP}}^t+{P}_{\mathrm{Bat},d}^t={P}_{\mathrm{e}}^t+{P}_{\mathrm{Bat},c}^t\vspace*{-12pt} $$
(5.36)
$$ \left(1-{\alpha}_t\right){H}_{\mathrm{GB}}^t+{\alpha}_t{H}_{\mathrm{CHP}}^t+{H}_{\mathrm{HS},d}^t={P}_{\mathrm{h}}^t+{H}_{\mathrm{HS},c}^t \vspace*{-12pt}$$
(5.37)
$$ {H}_{\mathrm{GB}}^t=\kern0.5em {\eta}_{\mathrm{GB}}{G}_{\mathrm{net}}^t $$
(5.38)

Equation (5.36) represents the balance of electrical power. Equation (5.37) also expresses the heat equilibrium equation, and Eq. (5.38) is the amount of thermal power generated by the boiler.

5.3.1.7 Objective Function

The purpose of this modeling is to reduce operating costs, including electricity and natural gas purchase costs, as well as to reduce the carbon emissions in air using various equipment and planning that are modeled as follows:

$$ C=\kern0.5em \min \kern0.5em \left({C}_{\mathrm{E}}+{C}_{\mathrm{G}}+{C}_{\mathrm{C}}\right) \vspace*{-12pt}$$
(5.39)
$$ {C}_{\mathrm{E}}=\kern0.5em \sum \limits_{t=1}^{24}\kern0.5em {\pi}_{\mathrm{E}}^t{P}_{\mathrm{Grid}}^t \vspace*{-12pt}$$
(5.40)
$$ {C}_{\mathrm{G}}=\kern0.5em \sum \limits_{t=1}^{24}\kern0.5em {\pi}_{\mathrm{G}}^t{G}_{\mathrm{net}}^t \vspace*{-12pt}$$
(5.41)
$$ {\displaystyle \begin{array}{l}{C}_{\mathrm{C}}=\kern0.5em {\pi}_{\mathrm{C}}\sum \limits_{t=1}^{24}\kern0.5em \left({\beta}_{\mathrm{e}}{P}_{\mathrm{Grid}}^t+{\beta}_{\mathrm{g}}{G}_{\mathrm{net}}^t\right)\\ {}\mathrm{s}.\mathrm{t}.:\left(3-1\right)\;\mathrm{to}\;\left(3-30\right)\end{array}} $$
(5.42)

Equation (5.39) represents the objective function, consisting of three functions that are the purchase cost of electricity, the cost of purchasing natural gas, and the cost of carbon emissions in the air, and the equation of each of them is obtained from Eqs. (5.40) to (5.42).

5.4 Numerical Results

5.4.1 Data

In this section, the technical information of the system, including the price of energy carriers, consumer information, and equipment information, will be shown for use in the simulation process. Table 5.1 shows the price of electricity and natural gas in the time of use tariff. The amount of the natural gas distribution coefficient between the CHP and the boiler units is presented in Table 5.2. Also, information about electricity and heat storage devices is given in Table 5.3. The amount of daily energy consumption, the minimum and maximum allowable power consumption, and the operating time for the controllable electric and thermal equipment are shown in Table 5.4. In addition, the pattern of uncontrollable electric and thermal loads for different times are shown in Fig. 5.5. The CHP unit has an electrical and thermal efficiency of 45% and 35%, respectively, and the maximum input of natural gas to it is 2.5 kW. Five scenarios are generated for modelling of solar panel output uncertainty that are shown in Fig. 5.6.

Table 5.1 Price of energy carriers in TOU tariff
Table 5.2 Dispatch factor at different hours
Table 5.3 Information of energy storages
Table 5.4 Controllable loads data
Fig. 5.5
figure 5

Profile of uncontrollable loads

Fig. 5.6
figure 6

Solar panel outputs in different scenarios

5.4.2 Results

The CHP unit, by producing electricity from natural gas, can partly reduce operating costs because in this modeling the price of natural gas is less than electricity. Figure5.7 shows the amount of electricity and heat generated by the CHP unit. As can be seen, at different times, the ratio of generated heat to the generated electricity is equal, and this is due to the approximate modeling of the CHP unit. Figure 5.8 also shows the controllable electrical and thermal load profile. It can be seen that when the price of energy carriers is low, these loads work at their maximum power, and when the price of energy carriers is high, they work at their minimum power, that is, they are transferred to off-peak hours to reduce the costs of operation.

Fig. 5.7
figure 7

CHP outputs

Fig. 5.8
figure 8

Profile of controllable loads

Energy storages store energy when the price of energy carriers is low, and give stored energy to consumers when their cost is high. Figure 5.9 represents the state of charge of electrical and thermal storage. For example, the battery is charged between hour 13 and 17, with low electricity price, and discharged from hour 18 to 21, when the price of electricity is high. Similarly, the heat storage is charged between hour 15 and 18, with low natural gas prices, and discharged when the price of natural gas is high.

Fig. 5.9
figure 9

SOC of energy storages

Solar panels, as clean energy sources, have a significant impact on reducing carbon emissions, as well as reducing the cost of purchasing natural gas and electricity from the networks. On the other hand, the output of the solar panels is uncertain, and for this reason, using the Normal probability distribution function, five scenarios have been generated to examine the effect of solar panels on the energy hub. Table 5.5 shows the impact of each scenario on operating costs. As can be seen, with the increase in the amount of electricity produced by solar panels, the costs of air pollution, electricity, and natural gas have been reduced.

Table 5.5 Impact of solar panels output on cost of operation (Cent)

After completing simulations, the operating in the form of energy hub is compared with the base case. Figure 5.10 shows the electricity and natural gas purchases in this simulation. In the base case, the energy carriers were individually operated and the amount of energy input to the energy hub per hour was dependent on the amount of load consumed at that hour. With adding different equipment to proposed residential building, the energy management has been optimized. The CHP unit by generating power from natural gas, energy storages by storing energy at off-peak times and delivering at peak times, and solar panels by generating power from sunlight, help to reduce the operating costs and carbon emission. According to Fig. 5.10, in the base case, the energy consumption at the peak times is high, but in the operating in the form of the energy hub, the energy consumption shifts to off-peak times, and also the energy hub can sell energy to the grid. Table 5.6 shows the overall simulation results, including electricity, natural gas and carbon emissions, as well as total operating costs, which are the total cost of each step of the simulation.

Fig. 5.10
figure 10

Energy hub inputs. (a) Base case, (b) energy hub

Table 5.6 Cost of operation (Cent)

5.5 Conclusion

So doing simulations and reviewing the results will be discussed in this chapter by the conclusion of the modeling. In this chapter, optimal utilization of integrated energy systems in the form of energy hubs was used to reduce operating costs and reduce air pollution. In modelling, a smart residential building was considered as an energy hub controlled by the Internet of Things technology. Simulations were carried out in the presence of various equipment such as the CHP unit, power and heat storage equipment and renewable resources, and the role of each of them was investigated. Electricity and natural gas pricing was based on the time of use tariff in order to see the impact of the price of energy carriers on optimal utilization. It was observed that the existence of a CHP unit by generating electricity and heat from natural gas and supplying part of the needs of consumers reduced the cost of purchasing electricity in peak hours. In addition, the energy storage equipment had an important role in reducing costs by storing energy at peak hours when the energy costs are low and delivering the stored energy to subscribers at off-peak times when energy costs are high. The presence of renewable resources as clean energy sources contributed greatly to reducing operating costs and reducing air pollution.

In the future works, various studies can be investigated as follow:

  • Adding other energy carriers such as water and district cooling into the model

  • Employing more efficient uncertainty modeling methods such as Information Gap Decision theory or robust optimization

  • Modelling the interactions between different energy hubs with private owners through multi-agent based approaches

  • Considering both energy and gas markets with detailed specifications

  • Deploying cutting-edge technologies within the energy hubs