1 Introduction

Interdependent energy infrastructures are an integral part of our modern societies. In these infrastructures, different energy carriers must be dispatched considering their availability, cost, efficiency, security, and environmental impacts. In this regard, microgrids (MGs) can provide a unique opportunity for the effective coordination between these infrastructures to reduce the total operation cost of the network. MG can be defined as an energy hub where multiple energy carriers can be consumed, stored, conditioned, and converted into other required forms of energy [1]. Consequently, in operation studies of MGs, a key question must be addressed: what is the optimal contribution of each energy carrier?

In general, natural gas (NG) and electricity are the two principal energy carriers for supplying the energy demand of MGs. During the last few years, the interdependence between these systems has increased which stems, partially, from the proliferation of ultra-efficient gas-fired units, especially combined heat and power (CHP) systems [2]. What makes the case even more challenging is the extensive use of distributed energy resources (DERs) and energy storage technologies, which adds to the flexibility and complexity of MG operation at the same time.

This paper aims at establishing an optimization model for the optimal operation of MGs. The objective of the proposed model is to use the full potential of MG facilities (i.e., CHPs, electricity storage units, heat storage units, and DERs) in order to reduce the operation cost of the MG while considering network security limitations. The proposed model handles the complexity of the MG operation problem, while taking advantage of its flexibility.

The growing physical and functional ties between different energy carriers have attracted the attention of several researchers. From a transmission-level point of view, [3] has developed an optimization model for the optimal power flow in a multi-carrier energy system to utilize the synergy among various forms of energy. The authors in [4] have proposed a robust co-optimization model to coordinate the optimal operation of electricity and NG systems with uncertainties. Results from the proposed model demonstrate that power system scheduling is affected by the operation of NG system. Furthermore, deficient gas supply to gas-fired units would increase the operation costs of power systems. In [5], a mixed-integer nonlinear programming (MINLP) model was developed with the aim of minimizing the investments and enhancing the reliability of coupled gas and electricity networks. The method developed in this reference has presented with compelling evidence that the proposed framework can offer a reasonable trade-off between investment cost and reliability of the overall system.

Recently, some researchers have made strong efforts to propose energy management schemes for multi-carrier MGs [6,7,8,9,10]. In this regard, a hierarchical energy management system (EMS) for a multi-carrier MG was proposed in [6], where the thermal and NG management systems are integrated with the conventional EMS. The developed approach decomposes the MG to sub-control layers based on the time-scale of control actions. Based on the time-scale decomposition, a hierarchical control structure utilizing the existing control schemes for different energy systems was designed to coordinate the sub-control layers. In another interesting work, a bi-level optimization model is proposed in [7] to identify the vulnerable components, and ensure the resilient operation of coordinated electricity and natural gas infrastructures considering multiple disruptions within the MG. The objective of the aforementioned work is to increase the resilience of energy supply and decrease the operation cost. However, the proposed model accounted for a simple model for the MG. A mathematical formulation based on the graph theory was developed in [8] to model the energy hub representation of the MG in steady-state analysis. The presented model in this reference seeks to avoid some limitations identified for the conventional (original) energy hub model. A deeper study showed that increasing the local renewable energy production can be used to convert the surplus electricity into thermal energy in order to gain economic efficiency [9]. To account for the environmental impacts, a multi-objective nonlinear model, which minimizes the operation cost and emission, is proposed in [10] and is solved by a new evolutionary algorithm called modified teaching-learning based optimization (MTLBO).

On the other hand, several researchers have focused on a lower level, i.e., individual homes [11,12,13,14]. For instance, the authors in [11] proposed a novel framework for home energy management (HEM) in the context of residential energy hubs. The two-point estimate method is employed to model the uncertainty of the rooftop solar panels. The results showed that the heat storage units can flatten the profile of NG demand in residential energy hubs. The method proposed in [12] minimizes the residential electricity cost of individual homes by shifting the demand over a daily forecast price cycle. According to this paper, the costs will not reduce considerably unless consumers change their demand pattern. A new smart home energy management system (SHEMS) based on IEEE802.15.4 and ZigBee communications is developed in [13]. The proposed SHEMS divides and assigns different home network tasks to suitable elements. The approach in [14] considers the real-time demand change in the smart home and handles the error caused by that through artificial neural network (ANN). Indeed, this work combines the long-term and short-term optimal energy dispatches in multi-carrier smart homes. Considering the existing works, a comprehensive model is needed to use the full potential of modern MGs to decrease the system operation cost while considering network security limitations.

This paper presents a mixed-integer linear programming (MILP) model for the optimal scheduling of smart MGs supplied by electricity and NG resources. The developed approach deploys the full potential of the MG facilities to reduce the operation cost of the system. Meanwhile, the network real-time limitations (e.g., bus voltage and line flow limitations) are modeled in the new methodology to guarantee the secure operation of the grid. The comprehensive model of a multi-carrier MG is illustrated in Fig. 1. This figure shows the different facilities of a typical multi-carrier MG. The proposed methodology manages electrical and heat demands of the MG as the outputs, and considers the electricity and NG as the inputs. In this context, an appropriate model is devised to aggregate various MG facilities such as DERs, CHP units, energy and heat storages, etc., in order to deploy the full potential of the grid to supply its different loads with the minimum operation cost.

Fig. 1
figure 1

Overview of a MG (energy hub)

The salient features of the proposed scheme could be summarized as follows:

  1. 1)

    Devise a comprehensive formulation for MG energy management in a multi-carrier energy framework.

  2. 2)

    Minimize the operation costs of the MG while the interdependence of both electrical and NG systems is taken into account.

  3. 3)

    Consider the AC operational constraints of MG to guarantee the network security.

  4. 4)

    Develop a linear formulation which yields computational efficiency in large-scale MGs.

2 Proposed formulation

In this section, the mathematical framework of the proposed energy scheduling model is presented. In this way, the objective function and problem constraints are described as follows.

2.1 Objective function

The total day-ahead operation cost of the MG is to be minimized as the objective function of the problem (1). Note that the operation cost of the CHP units stems from generating both electric and heat energy [see (31)]. Meanwhile, it is assumed that the MG operator has undertaken the complete control of renewable and conventional CHPs, energy storages, and distribution lines.

$$\hbox{min} \, \sum\limits_{{t \in \varOmega_{T} }} {\left( {C_{t}^{CHP} + C_{t}^{ST} + C_{t}^{shed} + C_{t}^{Heat} } \right)}$$
(1)

where \(C_{t}^{CHP}\) is the cost associated with operation of CHP units; \(C_{t}^{ST}\) is the cost of purchasing/selling power from/to the upstream grid; \(C_{t}^{shed}\) is the cost of electrical/heat load shedding; \(C_{t}^{Heat}\) is the cost of supplying heat loads with NG.

$$C_{t}^{CHP} = \sum\limits_{{i \in \varOmega_{B} }} {C_{it}^{CHP} }$$
(2)
$$C_{t}^{ST} = \rho_{t}^{ST} p_{t}^{ST}$$
(3)
$$C_{t}^{shed} = \sum\limits_{{i \in \varOmega_{B} }} {\left( {\rho_{it}^{shed} p_{it}^{shed} + \rho_{it}^{shedH} H_{it}^{shed} } \right)}$$
(4)
$$C_{t}^{Heat} = H_{t}^{Gas} \eta^{GH} \rho_{t}^{Gas}$$
(5)

where \(\rho_{t}^{ST}\) is the hourly price of day-ahead electricity market; \(\rho_{it}^{shed}\) is the value of lost loads (VOLL) for electrical loads at bus i and time slot t; \(\rho_{it}^{shedH}\) is the VOLL for heat loads at bus i and time slot t; \(\rho_{t}^{Gas}\) is the hourly gas price; \(C_{it}^{CHP}\) is the operation cost of the CHP unit at bus i and time slot t; \(p_{t}^{ST}\) is the active power exchange between the MG and the upstream grid in each time slot; \(p_{it}^{shed}\) and \(H_{it}^{shed}\) are the active and heat load curtailments at bus i and time slot t; \(H_{t}^{Gas}\) and \(\eta^{GH}\) are the hourly heat energy produced by NG and efficiency of gas to heat energy conversion. It is worth mentioning that in the proposed formulation, \(i \in \varOmega_{B}\) and \(t \in \varOmega_{T}\) stand for the index/set of MG buses and simulation time intervals, respectively.

2.2 Constraints

2.2.1 Operating constraints of power network

Equations (6)–(9) express the nonlinear AC power flow equations.

$$\begin{aligned} & p_{it}^{CHP} + p_{t}^{ST} + p_{it}^{Wnd} - p_{it}^{L} - p_{it}^{C} + p_{it}^{shed} \\ & \quad - \left( {p_{it}^{Stg + } - p_{it}^{Stg - } } \right) = \sum\limits_{{k \in \varOmega_{B} }} {l_{{\left( {i,k} \right)t}}^{P} } \\ \end{aligned}$$
(6)
$$q_{it}^{CHP} + q_{t}^{ST} - q_{it}^{L} + q_{it}^{shed} = \sum\limits_{{k \in \varOmega_{B} }} {l_{{\left( {i,k} \right)t}}^{Q} }$$
(7)
$$\begin{aligned} & l_{(i,k)t}^{P} = g_{{\left( {i,k} \right)}}^{L} \left( {V_{it}^{2} - V_{it} V_{kt} { \cos }\left( {\phi_{ikt} } \right)} \right) \\ & \quad \quad \quad - b_{{\left( {i,k} \right)}}^{L} V_{it} V_{kt} { \sin }\left( {\phi_{ikt} } \right) \\ \end{aligned}$$
(8)
$$\begin{aligned} & l_{(i,k)t}^{Q} = - b_{(i,k)}^{L} \left( {V_{it}^{2} - V_{it} V_{kt} { \cos }\left( {\phi_{ikt} } \right)} \right) \\ & \quad \quad \quad - g_{(i,k)}^{L} V_{it} V_{kt} { \sin }\left( {\phi_{ikt} } \right) \\ \end{aligned}$$
(9)

where \(p_{it}^{CHP}\) and \(q_{it}^{CHP}\) are the active and reactive power generation of CHP units at bus i and time slot t; \(q_{t}^{ST}\) is the reactive power exchange between the MG and the upstream grid; \(p_{it}^{L}\) and \(q_{it}^{L}\) are the active and reactive power consumption of loads; \(q_{it}^{shed}\) is the reactive power of curtailed electrical loads; \(p_{it}^{Wnd}\) and \(p_{it}^{C}\) represent the wind power generation and the combinational load that is supported through electric energy; \(p_{it}^{Stg + }\) and \(p_{it}^{Stg - }\) are the charging and discharging power of the electricity storage units; \(l_{{\left( {i,k} \right)t}}^{P}\) and \(l_{{\left( {i,k} \right)t}}^{Q}\) are the active and reactive power flows of the line from bus i to bus k at time slot t; \(g_{{\left( {i,k} \right)}}^{L}\) and \(b_{{\left( {i,k} \right)}}^{L}\) are the conductance/susceptance of lines; \(V_{it}\) and \(\phi_{ikt}\) are the voltage magnitude of buses and the voltage angle difference between buses i and k at time interval t. In (6) and (7), \(p_{t}^{ST}\) and \(q_{t}^{ST}\) are merely used for the bus at which the MG is connected to the upstream grid, i.e., the substation buses at the points of common coupling (PCC). For the remaining buses, these two variables are omitted from the left side of (6) and (7), respectively.

Voltage magnitude limits and line flow limits are imposed on the problem through (10) and (11). Owing to the fact that the summation of feeder injected active power from both sides is proportional to the square value of its current, the line flow limit in (11) is a limit on the feeder flowing current \(I_{{\left( {i,k} \right)t}}^{{}}\) (i.e., feeder thermal capacity).

$$\underline{V_{i}} \le V_{it} \le \overline{V_{i}}$$
(10)
$$l_{{\left( {i,k} \right)t}}^{P} + l_{{\left( {k,i} \right)t}}^{P} = \frac{{g_{(i,k)} }}{{g_{(i,k)}^{2} + b_{(i,k)}^{2} }}I_{{\left( {i,k} \right)t}}^{2} \le \overline{{l_{(i,k)}^{Loss} }}$$
(11)

where “” and “” are symbols for variable lower and upper limits in this paper; \(\overline{{l_{(i,k)}^{Loss} }}\) is the maximum power loss of line between nodes i and k. The constraints relevant to emergency load shedding are expressed as:

$$0 \le p_{it}^{shed} \le p_{it}^{L}$$
(12)
$$q_{it}^{shed} = p_{it}^{shed} \frac{{Q_{i}^{N} }}{{P_{i}^{N} }}$$
(13)

where \(P_{i}^{N}\) and \(Q_{i}^{N}\) represent nominal active and reactive electrical power demands at bus i. Finally, the limit on the amount of active and reactive power exchange between the MG and the upstream grid is defined as [15]:

$$\left( {p_{t}^{ST} } \right)^{2} + \left( {q_{t}^{ST} } \right)^{2} \le \left( {z_{t}^{Isl} \overline{{s_{t}^{ST} }} } \right)^{2}$$
(14)

where \(\overline{{s_{t}^{ST} }}\) is the maximum apparent power of the main transformer in MG; \(z_{t}^{Isl}\) is a binary parameter representing the islanding mode of the MG. During the islanded mode, \(z_{t}^{Isl} = 0\); otherwise, \(z_{t}^{Isl} = 1\).

2.2.2 Energy storage constraints

State of energy (SOE) of electricity storages in each time period is calculated as:

$$SOE_{it}^{Stg} = SOE_{i,t - 1}^{Stg} + \frac{{\eta_{i}^{Stg} p_{i,t - 1}^{Stg + } \Delta t}}{{\overline{E_{i}^{Stg}} }} - \frac{{p_{i,t - 1}^{Stg - } \Delta t}}{{\eta_{i}^{Stg} \overline{E_{i}^{Stg}} }}$$
(15)

where \(\eta_{i}^{Stg}\) and \(\overline{E_{i}^{Stg}}\) are the efficiency and the maximum energy of storage units. Constraints (16)–(20) are relevant to the initial value of SOE (16), final value of SOE (17), limitations on SOE (18), and charge/discharge power (19)–(20) associated with available storages in the MG.

$$SOE_{i,T_{ini}}^{Stg} = SOE_{i}^{ini}$$
(16)
$$SOE_{i,T_{fin}}^{Stg} = SOE_{i}^{fin}$$
(17)
$$\underline{SOE}_{i} \le SOE_{it}^{Stg} \le \overline{SOE}_{i}$$
(18)
$$0 \le p_{it}^{Stg + } \le \overline{P_{i}^{Stg + }} \beta_{it}^{Stg}$$
(19)
$$0 \le p_{it}^{Stg - } \le \eta_{i}^{Stg} \overline{P_{i}^{Stg - }} \left( {1 - \beta_{it}^{Stg} } \right)$$
(20)

where \(SOE_{i}^{ini}\) and \(SOE_{i}^{fin}\) are the initial and final SOE of electricity storages; \(\beta_{it}^{Stg}\) is a binary variable which indicates the charging/discharging mode of the storage (\(\beta_{it}^{Stg} = 1\) when the storage is in the charging mode, otherwise, \(\beta_{it}^{Stg} = 0\)) [15]; \(\bar{P}_{i}^{Stg + }\) is the maximum charging/discharging rate of the storage at bus i.

2.2.3 CHP constraints

Basically, the output power and heat of a CHP unit can change in a feasible operation region. A typical feasible operation region of a CHP unit is illustrated in Fig. 2 [16]. According to this figure, the region can be formulated with a set of linear equations as:

$$p_{it}^{CHP} - p_{iA}^{CHP} - \frac{{p_{iA}^{CHP} - p_{iB}^{CHP} }}{{H_{iA}^{CHP} - H_{iB}^{CHP} }}\left( {H_{it}^{CHP} - H_{iA}^{CHP} } \right) \le 0$$
(21)
$$\begin{aligned} & p_{it}^{CHP} - p_{iB}^{CHP} - \frac{{p_{iB}^{CHP} - p_{iC}^{CHP} }}{{H_{iB}^{CHP} - H_{iC}^{CHP} }}\left( {H_{it}^{CHP} - H_{iB}^{CHP} } \right) \ge \\ & \quad - \left( {1 - x_{it}^{CHP} } \right)M \\ \end{aligned}$$
(22)
$$\begin{aligned} & p_{it}^{CHP} - p_{iC}^{CHP} - \frac{{p_{iC}^{CHP} - p_{iD}^{CHP} }}{{H_{iC}^{CHP} - H_{iD}^{CHP} }}\left( {H_{it}^{CHP} - H_{iC}^{CHP} } \right) \ge \\ & \quad - \left( {1 - x_{it}^{CHP} } \right)M \\ \end{aligned}$$
(23)
$$0 \le H_{it}^{CHP} \le H_{iB}^{CHP} x_{it}^{CHP}$$
(24)
$$0 \le s_{it}^{CHP} \le s_{iA}^{CHP} x_{it}^{CHP}$$
(25)

where \(H_{it}^{CHP}\) is the heat output of CHP unit; \(x_{it}^{CHP}\) indicates the commitment status (i.e., on/off) of CHP units. When \(x_{it}^{CHP} = 0\), the output apparent electrical power and heat of the CHP unit are zero. Meanwhile, \(p_{iA}^{CHP}\) and \(H_{iA}^{CHP}\) denote the power and heat generation of CHP i in point A shown in Fig. 2. The limit on the amount of active and reactive powers of the CHP unit is defined as:

$$\left( {p_{it}^{CHP} } \right)^{2} + \left( {q_{it}^{CHP} } \right)^{2} \le \left( {\overline{{s_{it}^{CHP} }} } \right)^{2}$$
(26)
Fig. 2
figure 2

A typical feasible operation region of a CHP unit

The start-up and shut-down costs of the CHP unit are calculated as:

$$c_{it}^{SUCHP} \ge \rho_{i}^{SUCHP} \left( {x_{it}^{CHP} - x_{i,t - 1}^{CHP} } \right)$$
(27)
$$c_{it}^{SUCHP} \ge 0$$
(28)
$$c_{it}^{SDCHP} \ge \rho_{i}^{SDCHP} \left( {x_{i,t - 1}^{CHP} - x_{it}^{CHP} } \right)$$
(29)
$$c_{it}^{SDCHP} \ge 0$$
(30)

where \(\rho_{i}^{SUCHP}\) and \(\rho_{i}^{SDCHP}\) are the start-up and shut-down prices of the CHP unit at bus i; \(c_{it}^{SUCHP}\) and \(c_{it}^{SDCHP}\) are the start-up and shut-down cost of the CHP at bus i and time slot t. Finally, the total operation cost of a CHP unit can be expressed as [17]:

$$\begin{aligned} & C_{it}^{CHP} = \alpha_{i}^{CHP} + \beta_{i}^{CHP} p_{it}^{CHP} + \gamma_{i}^{CHP} H_{it}^{CHP} \\ & \quad \quad \quad + c_{it}^{SUCHP} + c_{it}^{SDCHP} \\ \end{aligned}$$
(31)

It must be expressed that the NG consumed by CHP units is considered in the coefficients \(\alpha_{i}^{CHP}\), \(\beta_{i}^{CHP}\) and \(\gamma_{i}^{CHP}\).

2.2.4 Heat constraints of MG

The balance between heat generation and consumption within the MG is satisfied by:

$$\begin{aligned} & \sum\limits_{{i \in \varOmega_{B} }} {\left[ {H_{it}^{CHP} - H_{it}^{L} - H_{it}^{C} + H_{it}^{shed} - \left( {H_{it}^{StgH + } - H_{it}^{StgH - } } \right)} \right]} \\ & \quad + H_{t}^{Gas} = 0 \\ \end{aligned}$$
(32)

where \(H_{it}^{L}\) and \(H_{it}^{C}\) are the heat load and the combinational load supported by heat energy at bus i and time interval t; \(H_{it}^{shed}\) is the heat load curtailment; \(H_{it}^{StgH + }\) and \(H_{it}^{StgH - }\) are the charging and discharging rates of heat storage units; \(H_{t}^{Gas}\) is the heat generated by burning NG. It is assumed that heat is transferred among different buses with ideal lossless pipes. This assumption in the small geographical area of a MG seems rational. Equation (33) expresses the emergency heat load drop at each bus.

$$0 \le H_{it}^{shed} \le H_{it}^{L}$$
(33)

2.2.5 Heat storage constraints

According to efficiency analysis provided in [18], the heat storage devices can considerably improve the performance of a MG in terms of economic savings. Similar to the electricity storages, the mathematical model of a heat storage is presented as:

$$SOE_{it}^{StgH} = SOE_{i,t - 1}^{StgH} + \frac{{\eta_{i}^{StgH} H_{i,t - 1}^{StgH + } \Delta t}}{{\overline{E_{i}^{StgH}} }} - \frac{{H_{i,t - 1}^{StgH - } \Delta t}}{{\eta_{i}^{StgH} \overline{E_{i}^{StgH}} }}$$
(34)
$$SOE_{i,Tini}^{StgH} = SOE_{i}^{iniH}$$
(35)
$$SOE_{i,Tfin}^{StgH} = SOE_{i}^{finH}$$
(36)
$$\underline{SOE}_{i}^{H} \le SOE_{it}^{StgH} \le \overline{SOE}_{i}^{H}$$
(37)
$$0 \le H_{it}^{StgH + } \le \overline{H_{i}^{StgH + }} \beta_{it}^{StgH}$$
(38)
$$0 \le H_{it}^{StgH - } \le \eta_{i}^{StgH} \overline{H_{i}^{StgH - }} \left( {1 - \beta_{it}^{StgH} } \right)$$
(39)

The mathematical symbols in this set of equations are pretty similar to those of the electricity storage units. It should be noted that the charging/discharging efficiency of a heat storage is typically higher than that of an electricity storage.

2.2.6 Linking constraint

In the proposed formulation, it is assumed that there is a set of combinational loads which could be supplied with either electricity or heat. The MG operator seeks to determine the optimal contribution of each energy carrier in supplying the combinational loads. The connection between different energy carriers (i.e., electricity and heat) is established as:

$$L_{it}^{C} = p_{it}^{C} + H_{it}^{C}$$
(40)

where \(p_{it}^{C}\) and \(H_{it}^{C}\) are positive decision variables; \(L_{it}^{C}\) is a parameter that indicates the amount of combinational load at bus i and time slot t, which can be supported by either electric or heat energy. It must be stressed that the detailed model of NG network is omitted in this paper since the complicated mechanism of its operation is usually considered in transmission level studies. Indeed, the proposed model in this paper is only applicable in multi-carrier MGs which are usually located within a small geographical area as opposed to large-scale bulk power systems.

2.2.7 Islanding considerations

In order to account for the islanded operation of the MG, we considered the following possible scenarios in the proposed formulation:

  1. 1)

    Intentional islanding. In this scenario, since the exact time of the islanding event is known, the optimal adjustments can be taken into account in the MG day-ahead scheduling plan. To embed this aspect in the proposed formulation, we included the binary parameter, \(z_{t}^{Isl}\) in (14).

  2. 2)

    Unintentional islanding. This scenario usually happens in MGs following the unforeseen faults in the upstream grid. After the unintentional islanding event, MG real-time control schemes are responsible for handling the power mismatch through the available reserve capacity in the network. If the amount of available reserve is not sufficient, under-frequency load shedding (UFLS) relays will be triggered to recover the load-generation balance [19]. In order to procure enough reserve in the day-ahead scheduling plan, we included the reserve constraint, (41) in the proposed model. Note that determination of total reserve requires stochastic analysis in terms of components failure, repair rates, and renewable resources uncertainties.

$$\sum\limits_{{i \in \varOmega_{B} }} {p_{iA}^{CHP} } - \sum\limits_{{i \in \varOmega_{B} }} {p_{it}^{CHP} } \ge p_{t}^{R}$$
(41)

where \(p_{t}^{R}\) is the required reserve at time interval t.

2.3 Linearization approach

The proposed optimization model presented in Sections 2.1 and 2.2 excluding (8), (9), (14), (26) is an MILP model. In order to reach global optimum point and have computational efficiency in real world cases, the aforementioned equations must be linearized. In this way, the AC power flow equations are replaced with (42) and (43), which have a linear form.

$$l_{(i,k)t}^{P} = g_{{\left( {i,k} \right)}}^{L} \left( {V_{it} - V_{kt} - \psi_{ikt} + 1} \right) - b_{{\left( {i,k} \right)}}^{L} \phi_{ikt}$$
(42)
$$l_{(i,k)t}^{Q} = - b_{{\left( {i,k} \right)}}^{L} \left( {V_{it} - V_{kt} - \psi_{ikt} + 1} \right) - g_{{\left( {i,k} \right)}}^{L} \phi_{ikt}$$
(43)

where \(\psi_{ikt}\) represents the piecewise linear approximation of \({ \cos }\left( {\theta_{ikt} } \right)\). Table 1 summarizes the applied assumptions in the linearization process. Detailed procedure for linearizing (8) and (9) can be found in [20, 21]. The efficiency of this approximation in distribution networks has been thoroughly analyzed in [15, 19].

Table 1 Applied assumptions in linearization process of AC power flow equations

Equations (14) and (26) represent the quadratic relation between active and reactive powers in CHP units and upstream substation transformer. These equations can be linearized with an efficient approach proposed in [22]. The original nonlinear equations are indeed the area inside a circle. The basic idea behind the linearization approach is that a regular convex polygon approximation of the circle is used in Fig. 3. Using a higher-order polygon results in lower approximation errors. However, increasing the order of approximation leads to a greater number of constraints in the problem formulation, which increases the computation intensity of the overall model. A suitable compromise between the solution accuracy and computational burden is obtained when a hexagon approximation is adopted. It must be stressed that if the whole hexagon falls inside the circle, the results will be conservative. By contrast, if the whole circle falls inside the hexagon, some non-solutions are taken as solutions. Consequently, a compromised approximation would be a polygon which falls between the two circles [22]. Considering (44) as the general form of (14) and (26), these equations can be written in a linear format using (45)–(47).

$$p^{2} + q^{2} \le s^{2}$$
(44)
$$- \sqrt 3 \kappa \left( {p + s} \right) \le q \le - \sqrt 3 \kappa \left( {p - s} \right)$$
(45)
$$\frac{ - \sqrt 3 }{2}\kappa s \le q \le \frac{\sqrt 3 }{2}\kappa s$$
(46)
$$\sqrt 3 \kappa \left( {p - s} \right) \le q \le \sqrt 3 \kappa \left( {p + s} \right)$$
(47)

where \(\kappa\) is a parameter which is equal to 1.0996 in hexagon approximation.

Fig. 3
figure 3

Hexagon approximations of a circle

3 Numerical results and discussion

3.1 Test case structure

The proposed model for MG energy management is examined on a modified IEEE 33-bus test system shown in Fig. 4. The basic data of the test system can be found in [23,24,25,26,27]. The modified network includes four CHP units whose general specifications are given in Table 2. Furthermore, three identical wind turbines (WTs) are placed at buses 14, 16, and 31. Since a MG is typically located in a small geographical area, the power outputs of these WTs are similar to each other. Figure 5 shows the forecasted power of WTs in the scheduling time frame [15]. In order to have realistic analysis, the electrical load pattern and day-ahead energy prices, derived from NYISO [27], are used in the simulations shown in Figs. 6 and 7. The hourly heat and combinational demand of the MG are assumed as depicted in Figs. 8 and 9. Two electricity storages as well as three heat storage units are considered in the simulations, whose data are given in Tables 3 and 4. In the simulations, \(\rho_{t}^{Gas}\) and \(\eta^{GH}\) are assumed to be $80 and 115%, respectively. According to (5), this means that 85% of the NG can be converted to heat energy.

Fig. 4
figure 4

Modified test system

Table 2 Technical data of CHP units
Fig. 5
figure 5

Forecasted power output of WTs

Fig. 6
figure 6

Electrical load profile during scheduling horizon

Fig. 7
figure 7

Electricity price during scheduling horizon

Fig. 8
figure 8

Heat load profile during scheduling horizon

Fig. 9
figure 9

Combinational (heat and electricity) load profile during scheduling horizon

Table 3 Technical data of electricity storage units
Table 4 Technical data of heat storage units

It goes without saying that obtaining an accurate and reliable scheduling for a MG depends on being fed with accurate input data such as daily load profiles, wind speed data, wholesale market price signals, etc. Therefore, it is assumed that the MG operator is equipped with efficient forecasting mechanisms, which are reliable enough in the decision making process.

3.2 Case study and discussion

In order to demonstrate the efficiency of the proposed formulation, three different cases are simulated and analyzed carefully in this section. The brief description of the simulated cases is outlined as follows:

  • Case 1: The combinational loads are assumed to be supplied only with electricity.

  • Case 2: The combinational loads are assumed to be supplied only with heat.

  • Case 3: The combinational loads can be supplied with either electricity or heat.

Figure 10 shows the total day-ahead operation cost of the MG for three cases. As it was expected, the highest economic saving is recorded in Case 3. The reason is that the optimization problem has more control variables in this case. To clarify, the combinational loads are supplied with electricity when it is cheaper than NG. On the other hand, they are supplied with heat when the production cost of heat (generated from NG) is lower than that of electricity. The breakdown of the MG total operation cost is depicted in Fig. 11. As can be seen, in different cases, the operation costs of the CHP units are similar to each other.

Fig. 10
figure 10

Total day-ahead operation cost of MG associated with different cases

Fig. 11
figure 11

Breakdown of MG operation cost

It can be inferred from Fig. 11 that the full potential of CHP units is successfully utilized for reducing the total operation cost in all three cases. To explain in more details, the electricity (heat) generated by CHP units around-the-clock are cheaper than the electricity (heat) provided by the upstream grid (NG). An interesting point in here is that although the operation cost of the CHP units in Case 2 is lower than that of Case 1 and Case 2, the overall operation cost of the MG is higher than that of Case 3. This shows that providing a portion of the network’s heat demand by CHP units is cheaper than providing that by NG burning.

According to Fig. 11b, the electricity provided by the upstream grid in Case 1 is much higher than that of the other cases. This issue happens since the combinational loads are merely supplied with electricity in this case. The key point to remember is that selling power to the upstream grid occurs in Case 2 and Case 3. However, in Case 1, the MG always buys electricity from the main grid since the electrical demand in this case is the highest among all cases. Indeed, the installed CHP capacity in the MG is not high enough to enable it to supply the network loads and sell electric energy to the upstream grid, when the market price is high.

Figure 11c illustrates the heat provided by NG in different cases in the scheduling horizon. As can be seen, the generated heat from NG in Case 2 is higher than that of Case 1 and Case 3. The reason is that in Case 2, the combinational loads are only supplied with heat. Specifically in Case 3, we can see that when the electricity price is high (i.e., 13–21), the combinational loads are supplied by burning NG as its price is constant during the scheduling horizon.

The SOE associated with electricity storage located at bus 26 and for different cases is shown in Fig. 12. According to this figure, the charging/discharging patterns associated with three simulated cases are similar to each other. Specifically, the storage device starts to charge when the electricity price is low (i.e., 24–05) and then starts to discharge when the electricity price is high (i.e., 14–19).

Fig. 12
figure 12

SOE of electricity storage 1 associated with different cases during scheduling horizon

The SOE of the first heat storage in different cases is obtained as Fig. 13. As can be seen in Case 1 and Case 3, the heat storage charges and discharges in different time periods. However, the heat storage in Case 2 only charges so as to lead its SOE to the desired value since the heat demand in this case is very high compared to the other cases.

Fig. 13
figure 13

SOE of heat storage 1 associated with different cases during scheduling horizon

It is worth mentioning that the optimization problems associated with different cases are solved using IBM ILOG CPLEX 12.4 and GAMS IDE. The average time needed for solving all of the cases is recorded less than 5 minutes on a PC with Intel Core i7 CPU @2.80 GHz and 6 GB RAM. This achievement implies the practical merits of the developed structure in real-world applications. Note that in all three cases, the MG security and operational constraints are considered and satisfied in the obtained solutions.

4 Conclusion

An MILP-based approach for managing electrical and heat demands in a multi-carrier MG environment is presented in this paper. The developed optimization framework minimizes the day-ahead operation cost of the MG while network operational constraints are taken into account. The proposed approach was successfully testified on a large-scale test MG with different illustrative case studies. The simulation results revealed that the novel approach determines the schedule of the MG optimally utilizing the full potential of various MG facilities (e.g., CHP units, WTs, electricity storages, and heat storages). Furthermore, it was shown that considering multi-carrier energy scheduling yields less daily operation cost in modern MGs. Meanwhile, computational efficiency of the new methodology makes it suitable for real-world applications. The uncertainty in the proposed model is still an open research topic, which will be studied in future works.