1 Introduction

Traditional distribution networks are highly required to reduce the dependency on the conventional and expensive operation methods. The current distribution power networks have concerned issues such as high carbon emissions, energy losses, fossil fuel consumption and unexpected outages. This requires the movement towards the smart distribution networks that allow the implementation of economic distributed energy resources and the sufficient enrolment of end-user customers into the electricity markets [1,2,3,4,5]. Microgrids have been designed in power systems to meet all these challenges and to improve the control of distributed energy resources from economic and technical perspectives. A microgrid can be defined as a combination of distributed generation, renewable energy resources, energy storage devices, responsive and non-responsive loads [6,7,8,9]. Microgrids create great opportunities in smart distribution networks, such as reducing operation cost by trading energy in the wholesale electricity market, reducing emissions by implementing renewable energy sources and deferring high transmission costs by installing demand-side generation [10,11,12,13]. One of the great advantages of a microgrid is the possibility to operate in off-grid from the main electric distribution network. The off-grid mode would allow a prompt and secure disconnection from a sudden outage in the main distribution network, which could effectively protect the local loads from a high disturbance [14,15,16]. The microgrids integration into conventional distribution networks would facilitate the market participation and provide multiple services such as enhancing voltage stability whilst minimizing the operation cost in a day-ahead electricity market as discussed in [17]. Microgrid could be designed in a power network to serve a multi-objective function to increase reliability, economic and environmental benefits. For example, in [18], a multi-objective function of a microgrid has been presented to minimize the gas emission cost, annual cost of loss load and life cycle cost. The study introduced reliability performance indicators to examine the expected unserved energy and loss of load probability. The results of the study proved the feasibility of the multi-objective function of the microgrid that has significantly reduced the cost of energy and the greenhouse gas emission cost as well as a high reduction in the number of people without access to electricity.

Furthermore, microgrids offer a wide range of energy prices for operators and end-user customers and can provide an efficient management of generation and demand during contingencies and islanded operation. For example, the authors in [19] illustrated how electric utilities could effectively maximize profit in a grid-connected microgrid using demand response. The study examined the impact of flexible and non-flexible loads within a microgrid when considering various energy prices. The results of the study confirmed that the profit of loads could be significantly improved when using dynamic pricing scheme as compared to the fixed pricing scheme. Another advantage of the microgrid is the ability to enrol end-user customers into the wholesale electricity market through the demand response program. Demand response program has been created in power systems to change the regular energy consumption by end-user customers in response to energy prices in electricity markets [20,21,22,23]. Demand response allows network operators to reduce the operation and maintenance costs particularly at peak times. There are different actions where the end-user customers could effectively participate in the electricity market through the demand response program. As an example, end-user customers could intentionally change their energy consumption by turning off less priority loads. Alternatively, end-user customers may shift some loads into off-peak times when energy prices are low. The demand response programs include the load shedding program and the load shifting program. In the load shedding program, the operator of the microgrid would curtail some of the dispatchable loads and compensate the end-user customers of the unsatisfied loads. The compensation might be a discount on the electricity usage, a direct payment or a credit to the end-user accounts. However, in the case of load shifting, the microgrid operator would only change the operation time of the dispatchable loads and compensate the end-user customers. The compensation cost of the load shifting is usually less as compared to the load shedding compensation cost [24,25,26,27]. These actions can be enrolled into two payment methods, which are the Incentive-Based Programs (IBP) and the Price-Based Programs (PBP) [28]. The IBP includes direct control, where network operators could remotely apply LS on participants’ devices. The end-user customers are usually residential and commercial, and able to receive valuable rate discounts and incentive payments. In addition, the IBP affords demand-bidding programs, where end-user customers would have the ability to directly provide load reduction offers in the wholesale electricity market [29,30,31,32]. Network operators who are involved in the IBP are able to set up an agreement with end-user customers to turn off their loads during outages or emergencies for predefined prices. On the other hand, the PBP is usually based on determined tariffs. The energy tariffs are designed to lower the energy consumption at peak times by increasing the level of the energy prices [33,34,35,36,37]. The PBP includes the Time of Use (TOU) rates, which provide variable energy rates based on the time and amount of the energy consumption. The TOU programs could effectively reshape the demand curve and accordingly reduce the operation costs of the generating units during high energy prices [38]. The load shedding application provides a wide range of solutions to many technical concerns, such as managing the high variability of the renewable energy resources, reducing the risk of unintentional transmission lines outages and providing ramping flexibility of natural gas operation [39,40,41,42].

Sufficient optimization methods are needed to reach the feasibility of installing microgrids and operating the distributed generation economically. Unit commitment and economic dispatch optimization techniques are vastly used in advance power systems to schedule the generating units, renewable energy resources, storage devices and responsive loads [43,44,45]. There are different approaches to accumulate the minimum operation cost and solve the unit commitment problem, for example dynamic programming [46, 47], priority list [48, 49], linear programming [50, 51] and mixed-integer linear programming MILP [52,53,54].

Demand response scheduling using mixed-integer programming has been investigated in [55]. The objective of the study was to illustrate the economic benefits of applying demand response program for security and reserve in power system. The authors have focused on the demand response by providing DRP and their responsibilities for regulating and trading LS amounts and prices in a day-ahead electricity market. The model was proposed to minimize the cost function whilst taking into consideration the aggregated customers’ responses. The independent system operators (ISO) would receive all the demand bids from the DRP to check their eligibility in the electricity market from security perspectives. The cost function in the study contained production, start-up, shutdown, reserve and security costs. In addition, the capacity cost of the demand response has been included in the cost function with variation of time. Some constraints in the study have been considered to ensure the feasibility of the optimization problem, such as balanced power flow, transmission lines congestion, min/max power generation and hourly min/max LS. Three case studies have been presented in the study, which included normal operation (case 1), 10% of the local demand as DRP (case 2) and 20% as DRP (case 3). The results of the study illustrated that valuable economic benefits have been accumulated using the LS application by the end-user customers.

In [56], a demand response program has been enrolled in an electricity and natural gas networks. The objective of the study was to draw attention to the considerable benefits of the demand response on scheduling dispatchable power units with natural gas constraints using MILP. The optimization problem included the operation cost of the thermal generating units, the contract cost of the natural gas supply and the cost of the LS. The nonlinear demand response bidding has been converted into piecewise function where the quantities and prices are presented as blocks. This strategy would facilitate the participation of the end-user customers into the scheduling of the power network and satisfy programming purposes. Two tradition power networks to examine the feasibility of the demand response have been used. The first network has six buses with three generating units, and the other one has 118 buses with 54 generating units. The numerical results have proved that the network operators could save $1247 per day on the small power network when end-user customers participated in the demand response program. In addition, applying the demand response on the larger power network has significantly reduced both the natural gas consumption and the location marginal price. A hierarchical demand response bidding and scheduling techniques that are coordinated by ISO have been proposed in [57]. The techniques have ensured smooth operation of all submitted and aggregated responsive loads from small groups of individual customers. The ISO would then deploy the required LS at certain times based on priorities and constraints of the wholesale electricity market. Moreover, the model has included the load reduction characteristics and preferences of each individual load into the ISO’s determinations. The proposed model has successfully provided the optimal operation of on-site generation and energy storage availability via the aggregated demand response. The contribution of this paper is applying the load shedding techniques in a microgrid to reduce the operation cost, and the results are compared to the traditional power network in [55]. There are some important parameters and constraints that have not been considered in the load shedding optimization problem in [55], which might significantly affect the accuracy of the optimal solution. In contrast, this paper clearly emphasizes the parameters and constraint related to load shedding such as pick-up/drop-off rates, maximum daily load shedding and min/max duration of the load shedding. Thus, ignoring these constraints would dramatically change the time and amount of the load shedding especially during the power exchange between the microgrid and the electricity market. In addition, all the generation units in [55] are conventional and dispatchable, whilst this paper considers both the dispatchable and the renewable energy resources. Moreover, an explanation on how the microgrid could significantly change the amount and time of the load shedding is discussed in this paper when the renewable energy resources are available. This paper presents an optimization method to simultaneously schedule a demand response program and local generating units within a microgrid. The optimization method evaluates the imported/exported power from/to the main distribution network, the supply from the dispatchable generating units, the amount of the available renewable energy and the required LS. The proposed optimization method is formulated using MILP with predefined constraints and parameters of the microgrid. The LS cost function is described by piecewise linear functions. The effectiveness of this method was approved in [52] through comparison with Lagrangian relaxation method, genetic algorithms and other methods. Moreover, binary variables have been incorporated in the proposed model to precisely determine the commitment of the dispatchable generating units and the operation status of the responsive loads.

The Bender Decomposition method is an optimization method used in power system to improve the overall performance and efficiency of an optimization problem with high number of sets, variables, binary variables and constraints. Bender Decomposition allows the implementation of power networks by effectively reducing the size of sub-problems. Therefore, the Bender Decomposition method reduces the required number of iterations, which leads to a significant reduction in the programming time and the size of the memory. In contrast, optimization method such as dynamic programming has huge computation burden when high number of variables and constraints are applied. In addition, the priority list is a common optimization technique with higher computation speed, however applying large number of constraints might dismiss the optimal feasible solution [52]. In this study, the optimization problem is defined as Benders Decomposition for programming purposes on CPLEX. Benders Decomposition method is applied in the optimization process to ensure a feasible solution with less execution time. The Benders Decomposition would split the original optimization problem into a master problem and sub-problems. The master problem is defined as MIP, whilst the sub-problems are solved as linear programming. The Benders Cuts are generated when the variables, which are obtained in the master problem, violate the constraints of the sub-problems. Moreover, this paper deeply demonstrates the relationship between some parameters of the responsive loads such as the pick-up/drop-off rates and the hourly operation cost of the microgrid. This relationship is investigated during both the on-grid and islanded-modes to ensure the feasibility of the proposed model. The optimization problem searches the minimum operation cost of the microgrid, which includes the generation cost, the power exchange cost with the main distribution network and the cost of the LS. Although the purpose of the optimization problem is to procure the minimum operation cost, additional load balance constraints have been included to satisfy the energy balance all the time.

The rest of this paper is organized as follows. Section 2 describes the mathematical representation of scheduling the optimal operation of the microgrid, the loads balance within the microgrid, the generation constraints and the LS constraints. Section 3 presents the case studies and the results, whilst the conclusion is given in Sect. 4.

2 Problem formulation

The objective of the microgrid operator is to minimize the cost function as shown in (1). First, the operation cost of the dispatchable generating units is evaluated by multiplying the power supply \( {\mathcal{P}}_{Gh} \) of generator \( G \) at hour h by the fuel cost \( {\mathcal{F}}_{G} \) of generator \( G \). The decision variables \( {\mathcal{A}}_{Gh} \) and \( {\mathcal{B}}_{Gh} \) are considered to be the start-up and shutdown indicators, respectively. If the \( {\mathcal{A}}_{Gh} \) is changed from 0 to 1, the start-up cost \( {\mathcal{S}}_{Gh}^{\text{UP}} \) is considered and the shutdown cost \( {\mathcal{S}}_{Gh}^{\text{Dw}} \) is zero. Similarly, if the \( {\mathcal{B}}_{Gh} \) is changed from 0 to 1, the shutdown cost is considered and the start-up cost is zero.

The second part of the cost function is the cost of the imported power \( {\mathcal{C}}_{dn}^{\text{import}} \), which is the multiplication of the hourly energy prices in the electricity market \( E\rho_{h} \) and the imported power \( {\mathcal{P}}_{dn,h}^{\text{in}} \) from the distribution network \( dn \) at hour h as specified in (2). Similarly, the third part of the cost function is the exported power to the distribution network \( {\mathcal{C}}_{dn}^{\text{export}} \) as shown in (3). The LS cost \( Csh_{d, h} \) will be explained in detail in Sect. 2.3.

$$ \begin{aligned} {\text{minimize}}\,CT & = \mathop \sum \limits_{h = 1}^{Nh} \left\{ {\mathop \sum \limits_{G = 1}^{NG} ({\mathcal{P}}_{Gh} *{\mathcal{F}}_{G} ) + ({\mathcal{S}}_{Gh}^{\text{UP}} *{\mathcal{A}}_{Gh} ) + ({\mathcal{S}}_{Gh}^{\text{Dw}} *{\mathcal{B}}_{Gh} )} \right\} + \mathop \sum \limits_{Dn = 1}^{NDn} {\mathcal{C}}_{dn}^{\text{import}} \\ & \quad + \mathop \sum \limits_{Dn = 1}^{NDn} {\mathcal{C}}_{dn}^{\text{export}} + \mathop \sum \limits_{d = 1}^{Nd} Csh_{d,h} \\ \end{aligned} $$
(1)
$$ {\mathcal{C}}_{dn}^{\text{import}} = E\rho_{h} *{\mathcal{P}}_{dn, h}^{\text{in}} $$
(2)
$$ {\mathcal{C}}_{dn}^{\text{export}} = E\rho_{h} *{\mathcal{P}}_{dn, h}^{\text{out}} $$
(3)

2.1 Load balance and DC optimal power flow of the microgrid

The load balance of the microgrid is ensured using (4). The power flow on each line \( FL_{Lh} \) is equal to the total power supply \( TPG_{Bh} \) on bus \( B \) at time h minus the total hourly demand \( D_{Bh}^{\text{Total}} \) on bus \( B \) at time h. The incident matrix of lines and buses \( \varUpsilon_{LB} \) is used in the microgrid to illustrate the connection of the buses and lines on the microgrid network. The multiplication of the incident matrix \( \varUpsilon_{LB} \) is required to adjust the number of rows and columns of the variable \( FL_{Lh} \) in (4).

The total power production includes the supply from the generators, the imported power, the exported power, the wind and solar as specified in (5). The binary variables \( \varPsi_{Gh} \), \( \varGamma_{dn, B}^{\text{in}} \) and \( \varGamma_{dn, B}^{\text{out}} \) are used to determine the operation status of the generators, imported power and exported power, respectively. The imported power from the distribution network is controlled to be less than the maximum imported power \( P_{\text{in}}^{\rm{Max}} \) and greater than the minimum imported power \( P_{\text{in}}^{\text{Min}} \) as shown in (6). Also, the hourly exported power is restricted to be less than the maximum exported power \( P_{\text{out}}^{\rm{Max}} \) and greater than the minimum exported power \( P_{\text{out}}^{\text{Min}} \) as depicted in (7).

$$ \mathop \sum \limits_{L = 1}^{NL} FL_{Lh} *\varUpsilon_{LB} = TPG_{Bh} - D_{Bh}^{\text{Total}} $$
(4)
$$ TPG_{Bh} = \mathop \sum \limits_{G = 1}^{NG} \varPsi_{Gh} *{\mathcal{P}}_{Gh} + \mathop \sum \limits_{dn = 1}^{Ndn} {\mathcal{P}}_{dn}^{\text{in}} *\varGamma_{dn,B}^{\text{in}} + \mathop \sum \limits_{dn = 1}^{Ndn} {\mathcal{P}}_{dn}^{\text{out}} *\varGamma_{dn,B}^{\text{out}} + \mathop \sum \limits_{W = 1}^{NW} {\mathcal{W}}P_{Bh} + \mathop \sum \limits_{S = 1}^{NS} SP_{Bh} $$
(5)
$$ P_{\text{in}}^{\text{Min}} \le {\mathcal{P}}_{dn}^{\text{in}} \le P_{\text{in}}^{\rm{Max}} $$
(6)
$$ P_{\text{out}}^{\text{Min}} \le {\mathcal{P}}_{dn}^{\text{out}} \le P_{\text{out}}^{\rm{Max}} $$
(7)

2.2 Thermal unit constraints of the microgrid

The local generators are controlled using (8). The hourly supply from generator \( G \) at hour h is less than the maximum capacity \( {\mathcal{P}}_{G}^{\rm{Max}} \) and greater than the minimum capacity \( {\mathcal{P}}_{G}^{\text{Min}} \). The ramping-up/ramping-down constraints are specified in (9) and (10). The operator of the microgrid is not allowed to increase the supply from generator \( G \) over the period h and \( h - 1 \) more than the specified ramping-up limit \( R_{G}^{\text{UP}} \). In addition, the supply from the generators cannot be decreased over the period \( h - 1 \) and h more than the specified ramping-down limit \( R_{G}^{\text{Down}} \).

$$ {\mathcal{P}}_{G}^{\text{Min}} \le {\mathcal{P}}_{Gh} \le {\mathcal{P}}_{G}^{\rm{Max}} $$
(8)
$$ {\mathcal{P}}_{Gh} - {\mathcal{P}}_{{G\left( {h - 1} \right)}} \le R_{G}^{\text{UP}} $$
(9)
$$ {\mathcal{P}}_{{G\left( {h - 1} \right)}} - {\mathcal{P}}_{Gh} \le R_{G}^{\text{Down}} $$
(10)

2.3 Load shedding constraints

The operator of the microgrid would combine the cost blocks and the demand blocks of the LS curve as illustrated in Fig. 1. The hourly load shedding \( Sh_{d,h} \) of load \( d \) at time \( h \) is the summation of the total demand segments \( {\mathcal{N}}B_{d,\lambda ,h} \), where \( \lambda \) is the index of the demand segment as specified in (11). The number of the demand segments of the LS is less than the maximum limit \( Sh_{d,\lambda }^{\rm{Max}} \) of load \( d \) of segment \( \lambda \) as shown in (12). The status of the LS is presented using the binary variable \( \varLambda_{d,h} \), which is one if the LS is on operation and zero otherwise. The hourly LS is less than the maximum LS (\( Sh_{d}^{\rm{Max}} \)) and greater than the minimum LS (\( Sh_{d}^{\text{Min}} \)) as described in (13). The LS cost \( Csh_{d,h} \) is calculated on hourly basis and consists of two parts as shown in (14). The first part is the initial LS cost, which is evaluated when the LS status \( \varLambda_{d,t} \) is changed from 0 to 1. The second part is the summation of the price segments of the LS \( \mu_{d,\lambda } \) multiplied by the demand segments \( {\mathcal{N}}B_{d,\lambda ,h} \). The binary variable \( \varLambda_{d,h} \) is included in this equation to control the initial load shedding cost \( Ic_{d} \), which is part of the hourly load shedding cost Csh. For example, if the status of the load shedding is 0 1 1 at hours 1–3, the hourly load shedding cost is considered at hours 2 and 3; however, the initial load shedding cost is only considered for one time at hour 2. The daily LS is controlled using (15), and it is less than the maximum limit \( {\mathcal{K}}^{\rm{Max}} \).

Fig. 1
figure 1

Demand response curve of the load shedding optimization

$$ Sh_{d,h} = \mathop \sum \limits_{\lambda = 1}^{N\lambda } {\mathcal{N}}B_{d,\lambda ,h} $$
(11)
$$ {\mathcal{N}}B_{d,\lambda ,h} \le Sh_{d,\lambda }^{\rm{Max}} $$
(12)
$$ \varLambda_{d,h} *Sh_{d}^{\text{Min}} \le Sh_{d,h} \le Sh_{d}^{\rm{Max}} *\varLambda_{d,h} $$
(13)
$$ Csh_{d,h} = Ic_{d} *\varLambda_{d,h} + \mathop \sum \limits_{\lambda = 1}^{N\lambda } \mu_{d,\lambda } *{\mathcal{N}}B_{d,\lambda ,h} $$
(14)
$$ \mathop \sum \limits_{h = 1}^{Nh} Sh_{d,h} \le {\mathcal{K}}^{\rm{Max}} $$
(15)

One of the most important characteristics of the LS is the pick-up and drop-off rates. The change of the LS over two consecutive hours is restricted using (16)–(19). The pick-up rate is the change of the LS at hour h minus the change of the LS at hour \( h - 1 \). The pick-up rate is less than the maximum pick-up rate \( ck_{d}^{{\max} } \) of load \( d \) and greater than the minimum limit \( ck_{d}^{{\min} } \). Similarly, the drop-off rate is the change of the LS at hour \( h - 1 \) minus the LS at hour h. The drop-off rate is less than the maximum limit \( dp_{d}^{{\max} } \) and greater than the minimum limit \( dp_{d}^{{\min} } \).

$$ Sh_{d,h} - Sh_{{d,\left( {h - 1} \right)}} \le ck_{d}^{\rm{max} } $$
(16)
$$ Sh_{d,h} - Sh_{{d,\left( {h - 1} \right)}} \ge ck_{d}^{\rm{min} } $$
(17)
$$ Sh_{{d,\left( {h - 1} \right)}} - Sh_{d,h} \le dp_{d}^{\rm{max} } $$
(18)
$$ Sh_{{d,\left( {h - 1} \right)}} - Sh_{d,h} \ge dp_{d}^{\rm{min} } $$
(19)

The time of the LS application is dependent on the preferences of the end-user customers. However, the maximum daily duration of the LS is limited using (20) and (21). The total hours of the LS over the period \( Nh \) has to be less than the maximum daily limit \( {\mathcal{R}}^{\rm{max} } \). In addition, the participants are not allowed to reduce the LS hours less than the predefined minimum limit \( {\mathcal{R}}^{\rm{min} } \). The minimum load shedding duration is an efficient tool to ensure that the operation hours for the load shedding are suitable for both the microgrid operator and the end-user customers without affecting the energy balance during the load shedding operation [58].

The LS on each bus is the hourly LS multiplied by the incident matrix \( \phi_{d,h} \) as explained in (22). This step is important to specify the location of the responsive loads on the network. Finally, the hourly demand of the microgrid is the scheduled demand \( {\mathcal{H}}d_{bh} \) on bus \( b \) at hour \( h \) minus the loads shedding \( LO_{bh}^{sh} \) as illustrated in (23).

$$ \mathop \sum \limits_{h = 1}^{Nh} \varLambda_{d,h} \le {\mathcal{R}}^{\rm{max} } $$
(20)
$$ \mathop \sum \limits_{h = 1}^{Nh} \varLambda_{d,h} \ge {\mathcal{R}}^{\rm{min} } $$
(21)
$$ LO_{bh}^{sh} = \mathop \sum \limits_{Sh = 1}^{Nd} \phi_{d,h} *Sh_{d,h} $$
(22)
$$ {\mathcal{D}}_{bh} = {\mathcal{H}}d_{bh} - LO_{bh}^{sh} $$
(23)

3 Numerical simulation

A microgrid consisting of four generating units, wind power, solar power and two responsive loads, is used to investigate the feasibility of the proposed method as demonstrated in Fig. 2. The mixed-integer programming MIP is used in this study to procure the optimal solution for a small-scale network. The optimization problem is divided into a master problem defined as a mixed-integer programming and sub-problems defined as linear programming. This technique allows a high number of sets, variables, parameters and constraints to be implemented. Therefore, this model can be easily extended to included large-scale network without affecting the feasibility of the solution. The data of the microgrid are obtained from the IIT Campus Microgrid [59, 60]. The optimization of the microgrid is implemented on a 1.3-GHz Intel Core i5 personal computer using CPLEX software [61], and the running tine is 0.44 s with 1335 iterations. The hourly electricity prices, local demand, wind power and solar power are given in Table 1. The characteristics of the generating units are given in Table 2.

Fig. 2
figure 2

Microgrid configuration

Table 1 Hourly electricity price, local demand, wind power and solar power
Table 2 Characteristics of the generating units

The following cases are studied:

  • Case 1: LS during on-grid mode.

  • Case 2: Pick-up (ck) and drop-off (dp) rates impact during on-grid mode.

  • Case 3: LS during islanded-mode.

  • Case 4: Pick-up and drop-off rates impact during islanded-mode.

3.1 Case 1

The amount of the LS is changing from 0 to 15% of the total local demand. The amount of the LS is divided into five demand segments to present the LS curve. The cost segments of the LS are 10, 11, 12, 13 and 14 ($/MW). The initial cost of the LS is 20 ($/MW). In order to provide an accurate linear model, an enough number of segments should be used. In this case, the demand response of the microgrid is divided into five segments as previously described in Fig. 1. Each demand segment presents a percentage of the hourly load shedding. If the load shedding is 10% of the total microgrid’s demand, which is 290 MW, each demand segment will be 5.8 MW. If the LS is 0%, the microgrid has to supply the whole local demand by importing power from the electricity market or producing power from the local energy resources. The microgrid would compare the energy prices in the electricity market with the production cost of the dispatchable generating units. The power exchange is positive when the microgrid importing power from the main grid and negative when the microgrid exporting power to the main grid. The loads of the microgrid L1 and L2 are located on buses 4 and 6, respectively. The loads L1 and L2 are each 50% of the total microgrid’s demand. The transmissions lines within the microgrid are constrained to be less than or equal to 5 MW. However, the line between the main grid and the microgrid, which is located on bus 1, is constrained to be less than or equal to 10 MW. The operator of the microgrid might turn on expensive generation units, which are located close to the loads, to avoid line congestion especially during peak-time. The supply of the dispatchable generating units has changed when the microgrid applied 5% LS on the local demand as illustrated in Fig. 3. The LS creates an opportunity for the microgrid to increase the exported power during high energy prices. The node of the load shedding is selected based on the constraints of both the load shedding and the transmission lines. The binary variable \( \varLambda_{d,h} \) is responsible on controlling the operation of the shedding loads. The index \( d \) is defined in the optimization problem to signify the location of the load shedding (1 or 2) at time \( h \) (1–24) as defined in (11)–(13). The cost segment and the power segment of Fig. 1 are identical on both loads L1 and L2. The total exported power increased from 20.4 to 35 MW when the LS increased from 0 to 5%. The LS is 5, 7.26 and 2.26 MW at hours 17–19. The total LS has satisfied the 5% of the local demand, which is 14.52 MW. When the LS increased to 10%, the total exported power increased to 49.4 MWh. The total exported power becomes 63.8 MWh when the LS increases to 15% of the local demand. The electricity price at hour 12 is 68.95 ($/MWh), whilst the production cost of Units 1 and 2 is 61.3 and 65.6 ($/MWh), respectively. However, the start-up cost of Units 1 and 2 is 10 ($/MWh). The start-up cost is added to the calculation of the operation cost if the unit commitment indicator is changed from 0 to 1. The microgrid only exported small amount of power (0.58 MW) at hour 12 due to the availability of the solar power.

Fig. 3
figure 3

Power supply in Case 1 with 5% LS

Figure 4 demonstrates the hourly operation cost, which consists of the production cost, the power exchange cost, and the LS cost. In addition, Table 3 shows the total operation cost of the microgrid with variable LS amount. The total operation cost of the microgrid is $8932 when the microgrid does not apply any LS. This cost is noticeably reduced to $7453 when 5% of the LS is considered. The minimum operation cost has been reached whilst taking into consideration many technical and economic constraints. These constraints include min/max power dispatch of the generating units, wind/solar power availability, min/max power exchange with the main grid, energy prices of the electricity market, hourly min/max load shedding, pick-up/drop-off rates of the load shedding. Therefore, any change in one of the defined constraints might significantly increase or decrease the operation cost of the microgrid.

Fig. 4
figure 4

Hourly operation cost in Case 1

Table 3 Total operation cost in Case 1 with variable LS amount

The total operation cost decreases from $6306 to $5193 when the LS increases from 10 to 15%. Although the microgrid paid $567 for 15% LS, the reduction in the operation cost reaches 41% as compared to 0% LS. This high saving in the operation cost is due to the LS during high energy prices at the electricity market, which eventually increases the export cost. The generation cost remains without any change even though the LS amount was changing. The reason is that the microgrid has to satisfy the technical and economic constraints such as start-up cost, ramping-up/ramping-down rates, and minimum on/off times.

3.2 Case 2

The amount of the LS remains 15% of the total demand. However, the ck and dp rates are changing in this case from 1 to 4 MW. The variability of the ck and dp rates has dramatically changed the schedule of the LS application. The ck and dp rates would restrict the flexibility of the microgrid to trade energy particularly during high energy prices. First, the ck/dp limit is considered to be 1 MW. That means the end-user customer will not be allowed to change the consumption more than 1 MW over two consecutive hours. The LS becomes 1, 2, 3, 4, 5 and 6 MW at hours 19–24, respectively. Although the maximum LS amount was considered to be 15% of the local demand, the LS only becomes 7% as a result of the ck/dp constraint. The exported power decreased from 63.8 to 41.3 MWh, which is a 35% reduction as compared to Case 1. The exported power is significantly increased to 55.8 MW when the ck/dp limit is changed from 1 to 2 MW. The hourly power exchange with variable ck/dp limit is demonstrated in Fig. 5. The maximum exported power is 63.8 MW when the ck/dp is 4 MW. Any increase in the ck/dp limit more than 4 MW will not increase the exported power due to the limitation of the local generating units and LS amount. The hourly load shedding amount with variable ck/dp constraint is depicted in Fig. 6.

Fig. 5
figure 5

Hourly power exchange with variable ck/dp constraints (Case 2)

Fig. 6
figure 6

Hourly load shedding with variable ck/dp constraints (Case 2)

The reduction in the ck/dp limit has negatively affected the hourly operation cost of the microgrid. Table 4 depicts the details of the operation cost with a variety of ck/dp limitations. The total operation cost with ck/dp = 1 MW is noticeably increased to $7832 due to the restriction on the exported power. The microgrid needs to satisfy the new ck/dp limit irrespective of the energy prices in the wholesale electricity market and the production cost of the local generating units. The microgrid is slightly reduced the operation cost to $6752 when the ck/dp limit is increased to 2 MW. The scheduling of the LS has been successfully improved when the ck/dp limit increased to 3 MW. The operation cost has been reduced to $5859 as a result of the ck/dp of 3 MW. The microgrid procured more considerable economic benefits when the ck/dp increased to 4 MW. The operation cost reached $5257 as a result of changing the ck/dp limit from 3 to 4 MW. The reduction in the operation cost is significantly high when the ck/dp limit is changed from 1 to 2 MW. In contrast, the reduction in the operation cost is low when the ck/dp limit is changed from 3 to 4 MW. The reason behind this is that the average change of the hourly demand is 2 MW over two consecutive hours. High ck/dp value would significantly release the microgrid’s constraints of the generating units and enhance the economic opportunities during high energy prices.

Table 4 Total operation cost in Case 2 with variable ck/dp limit

3.3 Case 3

The LS application is applied in this case during islanded-mode. The islanded-mode is considered during unintentional power supply interruptions from the main grid or for security purposes. The LS amount is changing from 0 to 15% of the total demand. The defined constraints of the LS remain unchanged such as the hourly min/max LS. The microgrid is supplying only the local demand since the power transfer is unavailable. Therefore, the operation cost of the microgrid is only the local production cost and the cost of the LS. First, when the LS is 0% of the local demand, the microgrid supplies the hourly demand irrespective of the high production costs, particularly of Units 3 and 4. The microgrid reduces the supply of the local generating units when the LS increases. Figure 7 depicts the power supply of the microgrid with 5% LS during islanded-mode. Units 1 and 2 are essential to supply the base load during islanded-mode; however, the microgrid might reduce the supply of Units 3 and 4 due to the high production cost and the possibility of the LS. The total supply of Unit 3 is 34, 25.4, 17.8 and 18.6 MW when the LS is 0, 5, 10 and 15%, respectively. The microgrid has effectively reduced the supply of Unit 3 by 54% when the LS was increased from 0 to 15% of the local demand. Moreover, the total supply of Unit 4 is 12.8, 6.22, 2.4 and 1.6 MW when the LS is 0, 5, 10 and 15%, respectively. The power supply reduction of Unit 4 is 12.5% when the LS was changed from 0 to 15%.

Fig. 7
figure 7

Power supply in Case 3 (islanded-mode with LS)

The optimal solution of the load shedding is occurred at hours 18–22 due to several reasons. Since the technical constraint and energy balance take priority, the microgrid has to clear and ensure all the defined constraints. For example, the microgrid might delay the load shedding time because of the limited ramping capability of the generating units over two consecutive hours. At hours 18–22, the microgrid is successfully satisfied all the defined constraints related to generation and load shedding such as the hourly min/max load shedding, daily limit of the load shedding and min/max duration of the load shedding. The load shedding at hours 18–22 is the most effective time to reduce the hourly operation cost whilst taking into consideration all the economic and technical perspectives. Applying LS during islanded-mode has effectively reduced the hourly operation cost. The operation cost is high at hours 1–9 due to the fixed and high production cost of the local generating units compared to the various options at the electricity market. The operation cost reached its maximum value when the LS is 0%, whilst the minimum value is when the LS is 15%. Table 5 demonstrates the total operation cost of the microgrid with variable LS amounts during islanded-mode. The reduction in the operation cost is 6.5, 12.7 and 16.8% when the LS is 5, 10 and 15% of the local demand. The details of the hourly operation cost with variable LS during islanded-mode are illustrated in Fig. 8.

Table 5 Total operation cost with variable LS amount in Case 3 (islanded-mode)
Fig. 8
figure 8

Hourly operation cost with variable LS during islanded-mode

3.4 Case 4

In this case, the ck/dp limit of the LS is examined during islanded-mode. The LS is considered 10% of the local demand to compare the results with Case 2, i.e. islanded-mode Vs connected mode. The ck/dp limit is changing from 1 to 4 MW. The operator of the microgrid has less flexibility to change the demand when the ck/dp limit is low. For example, when the ck/dp limit is 1 MW, the LS is 1, 2, 3, 4, 5 and 6 MW at hours 19–24, respectively. It can be noticed that the ck/dp limit has forced the operator of the microgrid to smoothly change the variation of the LS over two consecutive hours within the specified constraint.

When the ck/dp limit increases, the microgrid would easily reduce the supply from expensive generating units and increase the supply from cheap generating units as demonstrated in Fig. 9. The total supply of Units 1 and 2 is effectively increased from 216 to 225.8 MW when the ck/dp limit is increased from 1 to 4 MW. In addition, the total supply of Units 3 and 4 is 38 MW when the ck/dp limit is 1 MW. However, this value is significantly reduced to 20.1 MW when the ck/dp limit increased to 4 MW. Therefore, the increase in the ck/dp limit has enhanced the reduction from these two expensive units by 47% as compared to the (ck/dp = 1 MW). When the ck/dp is 4 MW, the LS is dramatically changed to 4, 5.8, 5.08, 5.32, 4.85, and 3.95 MW at hours 15–20, respectively.

Fig. 9
figure 9

Total power supply comparison in Case 4 with variable ck/dp limits

This case reveals that the ck/dp has a direct impact on the LS during islanded-mode. Although the operation cost is high during the islanded-mode, the high ck/dp limit has effectively enhanced the reduction in the supply from the expensive units. The details of the operation cost during islanded-mode with variable ck/dp limit are illustrated in Table 6. The operation cost is reduced by 4.2% when the ck/dp limit is changed from 1 to 2 MW. In addition, when the ck/dp limit is increased from 3 to 4 MW, the microgrid reduced the operation cost by only 0.27%. Therefore, the impact of the ck/dp limit during islanded-mode is less as compared to the connected mode. The maximum reduction in the ck/dp limit was 32.8% in Case 2, whilst it is only 6.83% in this case. The control strategy during the islanded-mode is completely different as compared to the on-grid mode. In the islanded-mode, the energy balance and technical constraints take priority irrespective of the high operation cost. Also, it is recommended to schedule higher ck/dp limit for the load shedding during the islanded-mode.

Table 6 Total operation cost with variable ck/dp limit (islanded-mode)

4 Conclusion

In this paper, an efficient strategy for optimizing and scheduling a microgrid that allows energy transactions with the main distribution network and the participation of the end-user customers has been provided. The microgrid involved generation units, renewable energy resources and responsive loads. The proposed model was formulated using mixed-integer programming MIP to accumulate the minimum operation cost whilst taking into consideration high number of variables, parameters and constraints. The proposed model has demonstrated the ability of the microgrid to exchange power with the main distribution network during on-grid mode and to secure islanding operation during off-grid mode. The end-user customers of the microgrid have been successfully enrolled in the optimization problem. The end-user customers have participated in the LS program during high energy prices to attain economic benefits. Moreover, this study has revealed the relationship between the pick-up/drop-off rates of the responsive loads and the operation cost. The operation cost of the microgrid decreases when the pick-up/drop-off rates increases. However, the pick-up/drop-off rates would not provide further reduction in the operation cost if these rates exceed a certain limit. The reason behind this is due to the limitation of the local demand and the constraints of the energy balance. The responsive loads have effectively reduced the operation cost of the microgrid during both the on-grid and off-grid modes. All the responsive loads in this study have been considered for the load shedding applications. For future work, this study could be extended to investigate the hourly operation cost of the microgrid when load shifting applications are applied. The price scheme of the load shifting would follow less compensation prices as compared to the load shifting, because the microgrid is obligated to supply the shifted loads at off-peak times.