Introduction

Supplying the electrical and heat demand of consumers produce the high amount of Carbon Dioxide (CO2) in the world. One of the main solutions to decrease this problem is meeting the local electrical and heat energy demands through the concept of energy hubs (EHs). In EHs, there are various energy resources such as combined heat and power (CHP) units, energy storages, and photovoltaic (PV) systems regarding which the EH operator (EHO) decides to supply demand. Moreover, the EHO participates in the wholesale energy markets to purchase its required energy. The EHO purchases energy from the day-ahead (DA) market regarding the forecasted parameters such as demand and output power of PV system. In the real-time (RT) operation regarding the uncertainty of PV system, the EHO may decide to trade energy with the RT market to minimize its total operation cost. Therefore, the aim of this paper is to propose a new decision making problem for the EHOs in the both DA and RT energy markets considering the uncertainties of PV system and RT energy prices.

Literature Review and Contribution

Literature Review

The optimal scheduling problem of the energy hubs is investigated in many studies. The operation problem of an energy hub system consisting of various carriers, i.e. electrical, heat, gas, and water, is modeled as a multi-objective function in (Dorahaki and Moghbeli 2020) [1]. In this problem, the demand response programs and electrical energy storages are employed by the system operator to increase the flexibility of the system. The day-ahead scheduling problem of the electricity and natural gas networks in the presence of energy hubs is modeled as a two-stage problem in [2]. In the first-stage, the day-ahead scheduling problem of each energy hub is solved regarding which the optimal scheduling of electricity and gas networks is determined by the independent system operator (ISO) in the next stage. The optimal scheduling problem of an energy hub system including electrical energy storage, photovoltaic arrays, combined cooling heating and power (CCHP) system, and electric vehicles is done in (Hou and Wang 2020) [3]. The problem is modeled as a stochastic model with the aim of minimizing the operation cost of the system in a rolling horizon fashion where the uncertainties is managed using a chance constrained programming approach. The authors of (Faraji and Ketabi, 2020) [4] propose a new stochastic optimization method to model the optimal scheduling of the energy hubs considering the N-1 contingency. A multi-objective optimization approach is developed in (Miao and Jermsittiparsert 2021) to model the operation problem of energy hub to minimize the operation cost and pollution emission considering demand response programs [5]. The authors of [6] proposed a mathematical model for the day-ahead operation problem of an energy hub system with the aim of minimizing the operation and the emission pollution costs. The scheduling problem of an energy hub system is modeled as a probabilistic scenario-based model in [7] considering the uncertainties of renewable energy sources and electricity market price. In this study (Lu and Feng 2020), an optimal load dispatch model is proposed for a community energy hub system to minimize the operation cost of the system. In this model, the uncertainties of electric vehicles are modeled through the Monte Carlo simulation approach and also the uncertainties of electrical energy price are modeled using a robust optimization approach. The day-ahead scheduling problem of an energy hub system is modeled as a scenario-based stochastic model in (Dini and Lehtonen 2019) considering the uncertainties on load, energy market price, renewable energy sources, and electric vehicles [8]. The operation problem of a renewable energy-based energy hub system is formulated as a multi-objective problem in (Eladl and Saadawi 2020) with the aim maximizing the social welfare and minimizing Carbon Dioxide (CO2) emission [9]. The authors of (Chamandoust and Bahramara 2019) proposed a multi-objective optimization problem of an energy hub system to minimize the operation cost, the pollution emission, and the deviation of the electrical load profile from its desired value. Moreover, the shiftable load strategy is employed by the system operator to shift the load regarding the market energy price [10].

Contribution

Reviewing the previous studies on the reliability of energy hub systems reveals that the optimal scheduling problem of the reliability in energy hub systems considering the both day-ahead and real-time energy markets is not investigated. Since the optimal scheduling of reliability in energy hub’s resources considering the participation of the energy hubs in these market is a great challenge for these systems, absence of the appropriate decision making models is a major research gap. Therefore, in this paper, a new two-stage stochastic optimization model is proposed for the reliability in energy hub systems for the optimal scheduling of their resources considering the day-ahead and real-time energy markets. For this purpose, the uncertainties of photovoltaic system and real-time energy price are modeled through a two-stage stochastic optimization model. In this model, the decision of the energy hub in the day-ahead market is considered as the first-stage decision and its decisions in real-time market and the optimal scheduling of reliability resources are considered as the second-stage decisions. Moreover, the risk of the energy hub’s decisions is managed through the Tail Value at Risk (TVaR) approach. Therefore, the main contributions of this paper are as follows:

  • Modeling the decision making problem of an energy hub in the day-ahead and real-time energy markets as a risk-based two-stage stochastic optimization approach to flexible Reliability.

  • Managing the risk of energy hub’s decisions in the day-ahead and real-time energy markets through the TVaR approach.

Paper Organization

The rest of this paper is organized as follows. The mathematical model of the problem is presented in Section 2. Numerical results are given in Section 3 and the conclusions are done in Section 4.

System Model

Modeling of the Electricity Market

The energy market players including generation companies (Gencos), large consumers, and retailers participate in the different markets to trade energy with each other (Rahmatian and Ghaderi Shamim 2021). The offers of producers and the bids of consumers are sent to the market operator regarding which the energy markets are cleared. The output of the markets is the energy market prices and the amount of power trading among the players. Some of the energy market players such as the energy hubs with low capacity participate in the different markets as the price-taker players. It means that they cannot change the market results and they accept the energy price of the markets. The energy hubs can participate in the day-ahead and real-time energy markets to purchase their required energy [11].

$${C}_e^P\left(\omega, t\right)={P}^P\left(\omega, t\right){\lambda}^P\left(\omega, t\right)$$
(1)
$${C}_e^{RTP}\ \left(\omega, t\right)=\sum\nolimits_{t=1}^T{CBL}_t\ast Regulate{d_{Tariff}}_t+\sum\nolimits_{t=1}^T\left({Load}_t^{actual}-{CBL}_t\right)\ast {\mathit{\Pr}}_t^{RTP}$$
(2)

Risk Measure

Since there are several scenarios in the stochastic optimization approach, the objective functions may have different values. To better analysis the output results, the expected value is considered for the objective function. Moreover, to manage the difference between the expected value and the amount of objective function in each scenario, the risk measure approaches are employed. For this purpose, in this paper, a combination of two measures called VaR and TVaR is used (see Fig. 1). The VaR is formulated as follows:

$$VaR\ \left(\alpha, x\right)=\max \left\{\ \xi :P\left(\omega |f\left(x,\omega \right)>\xi \right)\le 1-\alpha \right),\forall \alpha \in \left(0,1\right)$$
(3)
Fig 1.
figure 1

Diagrams of VaR and TVaR (Alexander and Baptista 2014) [12]

The equation of profit maximization with TVar is obtained as follows:

$$TVaR=\max \xi -\frac{1}{1-\alpha }\ \sum\nolimits_{\omega =1}^{\Omega}\pi \left(\omega \right)\eta \left(\omega \right)$$
(4)
$$-f\left(x,\omega \right)+\xi \le \eta \left(\omega \right),\kern2.25em \eta \left(\omega \right)\ge 0$$
(5)

Here, 𝜉 represents VaR, η(ω) is a variable that makes the profit/cost positive, and f(x, ω) is the objective function for the uncertain variable x under scenario ω.

Modeling of Objective Function and Constraints for the Short-Term Operation Mode

The architecture of the proposed energy hub in this paper is shown in Fig. 2. The electrical demand of energy hub can be supplied through purchasing energy form the day-ahead and the real-time market, and the optimal scheduling of energy hub’s resources, i.e., generators, CHP units, PHEVs, and solar panels. To reduce the effects of intermittent behavior of solar energy system, the PHEVs are employed to store the extra energy of this system in the hours with high power generation. The thermal demand of the system is supplied through the CHP units and boiler where both of these resources purchase their required natural gas from the gas market. Since the energy market price of the real-time market faces with high uncertainties, it is modeled in the decision-making problem of energy hub through the stochastic optimization approach. In this model, the amount of purchased energy from the day-ahead market is considered as the first-stage decision or wait and see. The amount of purchased energy from the real-time market and the optimal scheduling of energy hub’s energy resources are considered as the second-stage decisions or wait and see ones.

Fig. 2
figure 2

Overview of the assumed energy hub

The mathematical model of the proposed energy hub is modeled in this section [11]. The objective function of the energy hub is as (6).

$$\operatorname{Min} TC=\sum\nolimits_{\omega =1}^{\Omega}\pi \left(\omega \right)\sum\nolimits_{t=1}^T\left[\kern0.5em {P}_e^P(t){\lambda}_e^P(t)+{P}_e^{rt}\left(\omega, t\right){\lambda}_e^{rt}\left(\omega, t\right)+{S}_n^{DG}(t)\ {P}_{nts}^{DG}(t)+{\lambda}_h^{gas}\left({P}_h^{boil}\left(\omega, t\right)+{P}_h^{CHP}\left(\omega, t\right)\right)-\right({P}^{dch}\left(\omega, t\right){\lambda}^{rt}\left(\omega, t\right){\eta}^{st}+\left({P}^{PHEVs}\left(\omega, t\right){\lambda}^{PV}\left(\omega, t\right){\eta}^{st}\ \right]\kern0.5em$$
(6)

Where Pdch(ω, t) is the amount of discharged energy from the storage units, (Pdch(ω, t)λrt(ω, t)ηst is the profit from the electricity storage, (PPHEVs(ω, t)λPV(ω, t)ηst is the profit from the transfer of energy from PHEVs to the energy hub, and \({\lambda}_h^{gas}\)is the price of natural gas. To add the decision risk to this formulation, the TVaR is modeled as follows [13]:

$$\operatorname{Min}\ TVAR= TC+\left[\beta \left(\xi -\frac{1}{1-\alpha}\right)\ \sum\nolimits_{\omega =1}^{\Omega}\pi \left(\omega \right)\eta \left(\omega \right)\right]$$
(7)

Where β is a parameter that manages the balance of risk and objective function. The higher β means the risk is more important for the decision-maker [11]. Risk constraints are as follows:

$$\sum\nolimits_{t=1}^T\left[{P}_e^P(t){\lambda}_e^P(t)+{P}_e^{rt}\left(\omega, t\right){\lambda}_e^{rt}\left(\omega, t\right)+{S}_n^{DG}(t)\ {P}_{nts}^{DG}(t)+{\lambda}_h^{gas}\left({P}_h^{boil}\left(\omega, t\right)+{P}_h^{CHP}\left(\omega, t\right)\right)-\right({P}^{dch}\left(\omega, t\right){\lambda}^{rt}\left(\omega, t\right){\eta}^{st}+\left({P}^{PHEVs}\left(\omega, t\right){\lambda}^{PV}\left(\omega, t\right){\eta}^{st}\right]-\xi -\eta \left(\omega \right)\le 0$$
(8)
$$\eta \left(\omega \right)\ge 0$$
(9)

The proposed objective function is solved considering the technical constraints of energy hub’s resources as follows [14].

  • CHP’s constraints: Since the energy hub is assumed to contain CHP units, the constraints related to the feasible output compositions (heat versus electricity) should be considered. Fig 3. shows the CHP’s feasible heat-electricity output compositions, which should fall within an enclosed area. According to this figure, the constraints related to CHP are as follows [11]:

Fig. 3
figure 3

The enclosed area representing the feasible heat-electricity output compositions of the CHP unit

$${P}_e^{CHP}\left(\omega, t\right)+\left(\frac{P_A-{P}_B}{H_B}\right){P}_h^{CHP}\left(\omega, t\right)\le {P}_A.{\nu}^{CHP}\left(\omega, t\right)$$
(10)
$${P}_e^{CHP}\left(\omega, t\right)-\left(\frac{P_B-{P}_C}{H_B-{H}_C}\right){P}_h^{CHP}\left(\omega, t\right)\ge \Big[{P}_B-{H}_B\left(\frac{P_B-{P}_C}{H_B-{H}_C}\right){\nu}^{CHP}\left(\omega, t\right)$$
(11)
$${P}_e^{CHP}\left(\omega, t\right)-\left(\frac{P_D-{P}_C}{H_C}\right){P}_h^{CHP}\left(\omega, t\right)\ge {P}_D.{\nu}^{CHP}\left(\omega, t\right)$$
(12)

Where νCHP(ω, t) is a binary variable showing whether the CHP unit is on or off at the time t in the scenario ω.

  • Boiler constraints: The output of the boiler unit also has an upper and lower limitations, which are represented as follows:

$$0\le {P}_h^{Boil}\left(\omega, t\right)\le {P}_{h\ \mathit{\max}}^{Boil}$$
(13)
  • Electrical energy balance: The electrical demand is met with purchasing energy from the day-ahead and real-time energy markets, PHEVs, CHP, diesel generators, and the energy discharged from storage units as described in (14).

$${D}_e\left(\omega, t\right)={P}^P(t)+{P}^{rt}\left(\omega, t\right)+{P}^{DG}\left(\omega, t\right)+{P}_e^{CHP}\left(\omega, t\right)+{\gamma}^{PV}{P}^{PHEVs}\left(\omega, t\right)+{P}^{dch}{\gamma}^{rt}\ \left(\omega, t\right)$$
(14)

Here, γrtand γPVare the coefficients of The amount of energy stored from purchasing power in the real time market, and energy from PV that is stored in PHEVs, respectively.

  • Heat energy balance: The heat demand is met by boiler and CHP units as modeled in (15).

$${D}_h\left(\omega, t\right)={P}_{Boil}^{gas}\left(\omega, t\right){\eta}_h^{Boil}+{P}_{CHP}^{gas}\left(\omega, t\right){\eta}_h^{CHP}$$
(15)
  • Energy storage and PHEVs constraints: The constraints related to the storage units and PHEVs are as follows:

$${E}^{PHEVs}\left(\omega, t\right)={E}^{PHEVs}\left(\omega, t-1\right)+\left(1-{\gamma}^{PV}\right){P}^{PV}\left(\omega, t\right)-{P}^{dch}\left(\omega, t\right){\eta}^{PHEVs}$$
(16)
$${E}_{min}^{PHEVs}\le {E}^{PHEVs}\left(\omega, t\right)\le {E}_{max}^{PHEVs}$$
(17)
$${E}^{st}\left(\omega, t\right)=\left(1-{\gamma}^{st}\right){P}^{st}\left(\omega, t\right)-{P}^{dch}\left(\omega, t\right){\eta}^{st}$$
(18)
$${E}_{min}^{st}\le {E}^{st}\left(\omega, t\right)\le {E}_{max}^{st}$$
(19)
  • DG’s constraints: Since the energy hub contains diesel generators, the constraints related to these generators are modeled as follows. Also, since the power generation cost of the diesel generator is modeled as a step function, this generator can only operate at one step, which should be between its upper and lower limits.

$${\overline{P}}_{n-1}^{DG}\le {P}_n^{DG}\le {\overline{P}}_n^{DG}$$
(20)
  • Uncertainty equation: The uncertainties related to the price of real-time energy market and the output of solar production which is stored in PHEVs is modeled in this paper.

LOLE and LOLP are defined as Equations (21) and (22), respectively. These values must remain lower than a certain limit over the planning period.

$${LOLE}_l(y)\le \overline{LOLE_l^{t\ argeted}}$$
(21)
$${LOLP}_l(y)\le \overline{LOLP_l^{t\ argeted}}$$
(22)

The proposed approach in this paper to solve the presented model in the previous. First, different scenarios are generated for all times, then, using equation (6), the energy required for the energy hub is estimated. Finally, using equation (7), the amount of risk for the energy hub is calculated.

The resulted non-linear model is solved with the CPLEX solver in the GAMS software in a computer with a CPU core i5-2.5GHz and 4GB RAM.

Numerical Results

To show the effectiveness of the proposed model, it is applied on an energy hub system. The specifications of the CHP and boiler units are given in Table 1. The efficiency of equipment and the operation region of the CHP unit are derived from (Alexander and Baptista 2014) and (Alipour and Zare 2014), respectively. In this study, the feasible operation region of the CHP unit is considered as the area enclosed in the following four points: A(0,24.7), B(18,21.5), C(10.48,8.1), and D(0,9.88). The initial charge of the storage unit and PHEVs are assumed to be 50MW and their minimum and maximum charge levels are assumed to be 10 and 100 MW respectively. The time-dependent data related to electrical and heat demands, day-ahead and real-time energy market prices are given in Table 2. The standard deviations assumed for the real-time price and the solar radiation are 0.15 and 0.25, respectively. To model the uncertainties of solar radiation and real-time energy prices, 50 scenarios are generated for these parameters regarding which 2,500 scenarios are obtained. Then, regarding a scenario reduction technique, these scenarios are reduced to 200. These scenarios are shown in Figs. 4 and 5 in which the average value of the uncertain parameters and the scenarios 196 and 199 are shown. To investigate the effect of risk parameter on the decisions of the energy bub, two cases are defined, i.e., fixed and variable risk.

Table 1 Assumed energy hub specifications
Table 2 Assumed demand and daily market specifications
Fig. 4
figure 4

Generated real-time market price scenarios

Fig. 5
figure 5

Generated solar energy production scenarios

Fixed Risk

In this simulation, α and β are considered as the fixed parameters. Tables 3 and 4 shows the results of this simulation in terms of the amount of purchased energy from the day-ahead market. Figure 6 shows the amount of energy that the EHO trades with the real-time energy market. As shown in Fig. 6, the purchase energy decreases in hours 11-13 regarding the discharging power of PHEVs and storage units so that in some scenarios, the EHO can sell energy to the real-time market. Fig. 7 shows the rate of discharging power of storage units and the rate of energy transferring from PHEVs to the network (V2H) at different hours. It can be seen that most of the discharging has been done during peak hours. Figures 8 and 9 show the amount of solar energy stored in PHEVs and the amount of natural gas entering in the CHP unit, respectively. As shown in Fig. 8, because of the extensive use of stored energy in PHEVs, the storage levels in scenarios 196 and 199 are zero, but on average, some energy has been stored in PHEVs. Figure 10 shows the amount of thermal energy produced by the boiler. Since the heat load is constant, there is not much fluctuation in the boiler output. The final expected values (mathematical expectation) of cost and risk in this scenario are $ 260,137 and $ 269,722, respectively.

Table 3 The purchased energy from the day-ahead market
Table 4 Specifications of the components chosen for the system with and without reliability consideration
Fig. 6
figure 6

Purchased energy in the real- time market with different scenarios

Fig. 7
figure 7

Energy discharged from the storage units in different scenarios

Fig. 8
figure 8

Energy stored in PHEVs

Fig. 9
figure 9

Natural gas fed to the CHP unit

Fig. 10
figure 10

Thermal energy generated by the boiler

Variable Risk

This article proposed a hybrid strategy for modeling and formulation of the design of multicarrier microgrids (energy hubs) with reliability constraints. The proposed method involves developing a programming problem with the objective of minimizing operating and investment costs as well as the cost of energy not supplied for multiple loads. Multiple reliability indicators including the Cost of Energy Not Supplied (CENS), Energy Index of Reliability (EIR), Loss of Load Expectation (LOLE), and Loss of Load Probability (LOLP) were used in the optimization process to make sure of a reasonable level of reliability in meeting demand.

In the simulation with variable risk, the risk factor β is given values ranging from 0 to 100. Figure 11 shows the changes in the expectation of cost and the risk versus changes in the risk factor. Increasing the risk factor increases the expectation of cost and decreases the expectation of risk. Also, changing the importance of risk in decision-making (β) changes the decisions made by the EHO. Figure 12 shows the hub’s decision to purchase from the day-ahead market for β=0 and β=1. In the case where the risk is considered, the hub increases the purchased energy from the market. Since uncertainty is not considered in the day-ahead market, taking the risk into account can be expected to increase purchases from the day-ahead market. Figure 13 shows the average of the purchased energy from the day-ahead and real-time market at different hours in all scenarios. As shown in this Figure, with increasing the risk factor, the purchased energy from the real-time market reduces. On the other hand, the purchased energy from the day-ahead market increases when the risk factor increases.

Fig. 11
figure 11

Changes in the mathematical expectation of cost and risk versus risk factor

Fig. 12
figure 12

Impact of risk daily and real-time market purchases

Fig. 13
figure 13

Changes in purchases from the daily and real-time markets versus risk factor

To evaluate the method, multicarrier microgrid modeling was performed with and without reliability indicators. The results of the solution process, including the optimal values and specifications of microgrid components are given in Tables 3 and 4. In this evaluation, LOLE and LOLP were determined to be 10 hours (per year) and 0.1% (per year) respectively.

As shown in Table 5, in the model where reliability is taken into account, a larger CHP generator has been chosen to ensure greater electrical and thermal outputs. In this model, the type-3 transformer has been selected because of its lower unavailability (outage), the type-4 CHP generator has been chosen for its low unavailability and its ability to supply multiple carriers simultaneously, the type-4 heat generator has been selected for its low maintenance and good efficiency in supplying part of the required thermal energy, and finally, the type-3 photovoltaic unit has been chosen because of its ability to generate electricity at negligible cost and its good capacity and efficiency considering the investment cost. In comparison, the model where reliability is ignored has chosen a cheaper CHP generator and no heat generation unit.

Table 5 Reliability indicators obtained for the system with and without reliability consideration

As can be seen, considering the reliability constraints has led to significantly improved CENS. Table 6 compares the gross costs of the system over the planning period. It can be seen that reliability constraints have affected the type and size of components chosen for the multicarrier microgrid and the investment cost. It should be mentioned that considering reliability has drastically increased the overall cost of the system by restricting the options to the component that can satisfy reliability constraints. However, it also has significantly improved the system’s reliability indicators. These results demonstrate the ability of the proposed method to make sure that the demand is met with appropriate reliability. In the end, the cash flow diagram of the microgrid is drawn in Fig. 14 for a better economic analysis. According to this diagram, the energy hub with reliability constraints will pay back the capital spent in its development in about four and a half years. Comparing the proposed method with the methods provided in (Bahramara, 2021; [15]) shows that it results in a 22-24% increase in investment cost by requiring the energy hubs to meet the reliability requirements. Finally, it should be mentioned that while the analysis of multicarrier microgrid design with reliability consideration may prolong the optimization process, it certainly gives the planner a better understanding of the risks associated with changes in system costs and helps achieve more reliable and realistic results from the developer’s point of view.

Table 6 Economic analysis of microgrid costs with and without reliability consideration
Fig. 14
figure 14

Cash flow diagram of the considered multicarrier microgrid

Conclusion

In this study on the short-term operation of a network consisting energy hub with the goal of improving reliability under different risk levels with TVaR used as a risk measure, the results showed that increasing the assumed risk level will result in safer operation of the network and energy hubs acting more proactively in supplying their own loads. The result of this method can be examined from two perspectives: reduced operating costs and reduced frequency of blackouts due to improving reliability of energy hubs.