Keywords

10.1 Introduction

In recent years, for reasons such as increasing global demand for energy, efforts to reduce environmental pollution due to climate change, rising energy prices and traditional power grid, burn out the need to implement a sustainable, high-performance and secure smart network, sustainable and high-performance is felt more than ever. By modifying power grids to smart grids, MGs play an important role in providing electricity. MG usually contains set of distributed sources, energy storage system (ESS), and loads which can be exploited as a connection to the main grid or with an island performance. Regarding the type of load, MGs are divided into AC and DC types. The use of MG is an effective way to use distributed resources with a wide range of renewable energy sources to achieve goals such as improving power quality, increasing reliability, decreasing peak consumption, and improving energy efficiency [1, 2]. However MGs have disadvantages such as the complexity of network protection, absence of complete standards when reconnecting or separating these networks from the upstream network, increase high-frequency harmonics due to the use of power electronic devices, and voltage and frequency fluctuation. MG studies are usually divided into two groups:

  • The studies are related to the construction of MGs, which is aimed at using technologies in the construction of MG.

  • The studies relate to scheduling of MG operation aimed at providing optimal power generation program from various economic, environmental, and technical points of view to supply the load. Reliability, accountability, DRPs, network security, and losses are among the issues that are usually considered to be the optimal planning of unit production.

The optimal power generation planning with the goal of minimizing operating cost under various constraints is most studied on the exploitation of MGs by researchers. In [3] for an MG equipped with CHP units, a multi-objective model is designed to minimize the cost of exploitation and emission. The MG used includes electric only, heat only, CHP units, and ESS and has the ability to exchange power with the upstream network. The optimal 24-h scheduling is done with the aim of finding the optimal point of energy resources to achieve maximum possible profits in [4]. The desired planning for a sample MG is done in two modes of operation. The characteristic efficiency, reliability, economic and environmental requirements for the proper operation of the MG are provided in [5]. Hence, an economic-environmental planning methodology in an MG in a connected mode has been formulated. The objective is to minimize the cost of operation and emission as well as the amount of electricity purchased from the main grid at high-cost hours. The presence of RESs along with many advantages, due to the random nature and uncertainty of their output power, is one of the most fundamental challenges. Electricity market price and load demand are other uncertain parameters. In various studies, some of these parameters with random nature are considered in the form of differences between predicted and exact values and using various methods to reduce its impact. In [6] a stochastic method based on the technique of producing different scenarios is presented for modeling uncertainty. In [7], which has been investigated for intelligent energy management, the fuzzy method has been used to model the predicted parameters. Using a robust optimization method to reduce the uncertainty effect in [8] is proposed for the problem MG energy planning under conditions of consumption and heat uncertainty as well as electricity prices.

On the other hand, due to limited energy resources and growing consumption, it is important to use the best available resources. In the new system, one of the solutions to cover load and RES fluctuations is the development of system infrastructure that requires high capital or the use of existing units at the point of non-optimal work. While in order to overcome these problems and optimize the operation of the new structure, one of the cheapest methods is to use the demand response (DR). The stochastic operation scheduling for energy and reserve in an intelligent system is addressed in [9]. A part of required reserve is to cover the volatility of WT power and load procurement by responsive load that are able to participate in energy and reserve planning. A multi-objective energy management system is introduced to improve the short-term performance of MG, considering the random behavior of RESs in [10]. In this planning, various residential, commercial, and industrial loads are able to participate in load response programs. These programs are implemented in the form of incentive tariffs and in the form of price, offering packages that are based on the roulette cycle method. In order to implement DR, Ref. [11] has used a new incentive method. This incentive-driven mechanism is in fact a two-way contract that is obtained between the owners of DGs and consumers in the bottom buses through secondary bid auctions. The DRPs of direct load control type in electricity markets are evaluated in [12] using a nonlinear exponential model.

It should be noted that we are faced with an optimization problem in solving the grid scheduling problem. Different techniques and methods have been introduced to solve the optimization problems. These techniques are divided into a multi-class based on the type of the search space and target function. Simple linear programming, nonlinear programming method, and stochastic (dynamic) programming are examples of these methods. Although the numerical and mathematical methods are widely used in solving optimization problems, these methods require more computational process, which leads to unusual and uncertain results, due to the dimensions of the problem. Intelligent optimization algorithms such as genetic algorithms (GA) and particle swarm optimization (PSO) algorithms are among the smart methods that have been considered by researchers in recent years to solve optimization problems. References [13, 14] have applied a dynamic planning methodology for solving the optimization problem in an MG, taking into account the uncertainty of renewable sources and load. The goal is to maximize the benefit that a landlord can obtain from the energy business during a day from the grid.

The current paper focuses on the development and optimization of optimal operational planning of an MG equipped with diesel, wind, and storage units and in the upstream network connectivity mode with respect to different constraints. In this regard, the planning has been carried out in the uncertainty environment of the wind turbine, load, and electricity prices of the main network. Due to the importance of the problem and the type of grid, the technical losses related to the transmission line are also calculated and sought to reduce it. Then, using DRPs with an appropriate method and using a more accurate model, we are trying to optimize the operation of the production units and make them effective in the energy market. The impact of the implementation of these programs on the operating cost, the amount of losses, the amount of generators generated, the load profile, as well as the voltage profile and generally in the planning process are specifically answered. In order to solve the optimization problem resulting from planning, considering the type of problem and the advantage of heuristic and meta-heuristic methods , an intelligent method based on the PSO algorithm has been used.

The rest of this paper is organized as follows: In Sect. 10.2, the details of the modeling of uncertainty and DR as well as the formulation of the objective function and the constraints of the problem are expressed. Section 10.3 explains the method of PSO as a problem solution method . Section 10.4 presents simulation studies and discussions on the results. Finally, the conclusion is provided in Sect. 10.5.

10.2 Problem Formulation

10.2.1 Uncertainty Modeling

Wind turbine power output is dependent on wind speed and because wind speed is a random quantity, the wind turbine output will also be an uncertain quantity. Additionally, the amount of demand and energy price are also uncertain quantities. Therefore, exploitation of them is usually possible. In this paper, a stochastic programming formulation is used to model the uncertainty of these parameters. For this purpose, for wind power, the average wind velocity curve is extracted from the past data of this parameter in [15]. Then, using the speed-power curve, according to Fig. 10.1, the wind turbine output power for the planning period is obtained. The main network electricity price is also assumed for the certain mode according to the prediction of Ref. [15]. In order to model the uncertainty and implement a stochastic programming formulation, the limited and random forecasted error is considered for the mean wind speed curve, electricity price, and load forecast curve.

Fig. 10.1
figure 1

The relationship between the input wind speed and output power for wind generators

The following expression can describe the relationship between the input wind speed and output power of a wind turbine:

$$ \left\{\begin{array}{l}{P}_{\mathrm{WT}}=0\\ {}{P}_{\mathrm{WT}}={P}_{\mathrm{r}}\frac{V-{V}_{\mathrm{cin}}}{V_{\mathrm{r}}-{V}_{\mathrm{cin}}}\\ {}{P}_{\mathrm{WT}}={P}_{\mathrm{r}}\end{array}\right.\kern1em {\displaystyle \begin{array}{c}V\le {V}_{\mathrm{cin}}\kern0.5em V\ge {V}_{\mathrm{co}}\\ {}{V}_{\mathrm{cin}}\le V<{V}_{\mathrm{r}}\\ {}{V}_{\mathrm{r}}\le V<{V}_{\mathrm{CO}}\end{array}} $$
(10.1)

where v is the randomly varying wind speed, V0 is the location parameter, α is the shape parameter, and β is the scale parameter.

Considering the prediction error, the set of Eqs. (10.2) shows different scenarios and the probability associated with each of the wind turbine power parameters, the amount of consumption, and the energy price to investigate their uncertainty:

$$ {\displaystyle \begin{array}{l}{S}_{\mathrm{wind}}=\left\{\left({P}_{\mathrm{wind},1},{\pi}_{\mathrm{wind},1}\right)\ \left({P}_{\mathrm{wind},2},{\pi}_{\mathrm{wind},2}\right)\dots \right\}\\ {}{S}_{\mathrm{load}}=\left\{\left({P}_{\mathrm{load},1},{\pi}_{\mathrm{load},1}\right)\ \left({P}_{\mathrm{load},2},{\pi}_{\mathrm{load},2}\right)\dots \right\}\\ {}{S}_{\rho }=\left\{\left({\rho}_{E,1},{\pi}_{E,1}\right)\left({\rho}_{E,2},{\pi}_{E,2}\right)\dots \right\}\\ {}{\pi}_s={\pi}_{\mathrm{wind}}\times {\pi}_E\times {\pi}_{\mathrm{load}}\\ {}\sum \limits_{s=1}^{Ns}{\pi}_s=1\end{array}} $$
(10.2)

10.2.2 Demand Response Modeling

In this paper, RTP method is used to implement responsive programs. The mathematical model presented in [16] is also used to transfer power consumption from high consumption times to lower load times by increasing the price at peak times and decreasing it at off-peak times. The following mathematical model is introduced:

10.2.2.1 Elasticity

The change in demand for a unit of electricity price change is load elasticity and indicated by the E symbol:

$$ E=\frac{\rho_0}{d_0}\cdot \frac{\partial d}{\partial \rho } $$
(10.3)

10.2.2.2 Insider Elasticity

Changing the amount of load in the (i) time period due to the change in electricity prices in the same period (i):

$$ E\left(i,i\right)=\frac{\rho_0(i)}{d_0(i)}.\frac{\partial d(i)}{\partial \rho (i)} $$
(10.4)

10.2.2.3 Mutual Elasticity

The mutual elasticity of the period (i) relative to period (j) means the change in the load over time (i) due to the change in the electricity price during the period (j):

$$ E\left(i,j\right)=\frac{\rho_0(j)}{d_0(i)}.\frac{\partial d(i)}{\partial \rho (j)},\kern1em i\ne j $$
(10.5)

For a constant period (i), the sensitivity to all other time periods (j) must be calculated. For the 24-h period of this research, the matrix of self and mutual elasticity is formed as Eq. (10.6):

$$ \left[\begin{array}{c}\Delta d(1)\\ {}\Delta d(2)\\ {}\Delta d(3)\\ {}\vdots \\ {}\Delta d(24)\end{array}\right]=\left[\begin{array}{ccccc}E\left(1,1\right)& E\left(1,2\right)& \cdots & \cdots & E\left(1,24\right)\\ {}E\left(2,1\right)& E\left(2,2\right)& \cdots & \cdots & \cdots \\ {}\cdots & \cdots & E\left(i,j\right)& \cdots & \cdots \\ {}\cdots & \cdots & \cdots & \cdots & \cdots \\ {}E\left(24,1\right)& \cdots & E\left(24,j\right)& \cdots & E\left(24,24\right)\end{array}\right]\times \left[\begin{array}{c}\Delta \rho (1)\\ {}\Delta \rho (2)\\ {}\Delta \rho (3)\\ {}\vdots \\ {}\Delta \rho (24)\end{array}\right] $$
(10.6)

The elements on the main diameter represent the insider elasticity and non-diagonal elements representing the mutual elasticity (i, j). Regarding these equations, two types of responsive models can be extracted based on time tariffs:

First, the single-period model, which is only dependent on self-sensitivity and used for loads that cannot be transmitted to different periods (light loads). Second, the multi-period model is used for loads that can be moved in different periods; this means that consumption can be transmitted to mid-peak or off-peak times.

10.2.2.4 Final Demand Response Model

According to the presented explanation, the final demand response model based on the time tariff used in this paper is according to Eq. (10.7):

$$ d(i)={d}_0(i)\times \left\{1+\frac{E\left(i,i\right)\cdot \left[\rho (i)-{\rho}_0(i)\right]}{\rho_0(i)}+\sum \limits_{\begin{array}{l}j=1\\ {}j\ne i\end{array}}^{24}E\left(i,j\right)\cdot \frac{d_0(i)}{\rho_0(j)}\left[\rho (j)-{\rho}_0(j)\right]\right\} $$
(10.7)

10.2.3 Objective Function

The objective function minimizes the expected operating cost in an MG with the upstream network connection mode for the 24-h period. In this paper, a scenario-based stochastic method has been used to model wind turbine, load, and energy price uncertainty. In other words, the WT power output, load, as well as the electricity price of the network vary from scenario to scenario. Also the cost of producing WT has been ignored.

$$ \mathrm{OF}=\sum \limits_{s=1}^{N_s}{\pi}_s\left\{\sum \limits_{t=1}^T\left[{C}_{\mathrm{grid}}\left(t,s\right)+\sum \limits_{j=1}^{\mathrm{NDG}}\left({C}_{\mathrm{DG}}\left(j,t\right)\times {s}_{j,t}+\mathrm{SU}\left(j,t\right)\times {y}_{j,t}+\mathrm{SD}\left(j,t\right)\times {x}_{j,t}\right)+{C}_{\mathrm{str}}(t)\right]\right\} $$
(10.8)

According to Eq. (10.8), the cost of operating consists of different costs, which is further computed as follows. As mentioned the formulation of the problem is stochastic and dependent on the scenario. Also πs shows the probability of occurrence of each scenario.

CDG(j, t): The fuel cost of the diesel generator (DG) j is in the time period t:

$$ {C}_{\mathrm{DG}}\left(j,t\right)=\alpha (j)+\beta (j)\cdot {P}_{\mathrm{DG}}\left(j,t\right)+\gamma (j)\cdot {P}_{\mathrm{DG}}^2\left(j,t\right) $$
(10.9)

Cgrid(t, s): Expresses the cost of purchasing electricity from the main network, depending on the amount and price of the purchase at time period t. The amount of power exchange with the upstream network varies from scenario to scenario:

$$ {C}_{\mathrm{grid}}\left(t,s\right)={P}_{\mathrm{grid}}\left(t,s\right)\cdot {\rho}_{\mathrm{E}}\left(t,s\right) $$
(10.10)

ρE is the hourly electricity price of the main grid for the next day market and an uncertainty parameter. Therefore, its amount depends on different scenarios. Also, the MG has the ability to exchange power with the main network in two ways. If economic conditions require that electricity can be sold from the grid to the upstream network in this case, Cgrid is considered as a profit for the MG. This usually happens in peak times where prices are high and purchases from the main network has a lot cost to the MG operator.

Another important element of the grid, known as a virtual power plant, is the energy storage system, which is particularly useful when it comes to reducing electricity purchases from more expensive units at peak hours. In accordance with Ref. [17], the cost function of a storage device follows from Eq. (10.11):

$$ {C}_{\mathrm{str}}(t)=A\cdot \left|{P}_{\mathrm{str}}(t)\right|+B $$
(10.11)

Pstr(t) is the amount of power which the storage device receives from the network (charge) at the hour t or injects into the network (discharge). A and B, the constant coefficients of this function, are dependent on the storage factor, which is 0.1 and 0.35, respectively.

Also SD(j, t) and SU(j, t) indicate the costs of shutting down and starting up the DG which will be switched off and on again due to economic conditions.

Equation (10.12) indicates the amount of the losses of the MG in the total planning hours, which is dependent on the resistance and current of the MG lines, and is obtained by using the backward-forward power flow method and after calculating the lines current and buss voltage. The goal is to reduce the amount of these losses and its imposed cost.

$$ {P}_{\mathrm{loss},\mathrm{total}}=\sum \limits_{t=1}^{24}\sum \limits_{\mathrm{line}=1}^{32}{R}_{\mathrm{line}}\times {I}_{h,\mathrm{line}}^2 $$
(10.12)

10.2.4 Constraints

Minimizing the objective function referred to in the previous section should be subject to a series of constraints, including network constraints, unit constraints, and technical constraints. In this section, the mathematical model of each of these constraints is discussed.

10.2.4.1 Power Balance Constraint

One of the most important constraints that must be considered when planning MG production in order to ensure the correct and complete load, and to avoid problems of frequency stability and increase reliability, is the balance between the amount of production and consumption per hour of planning, which is the problem in Eq. (10.13):

$$ {P}_{\mathrm{grid}}\left(s,t\right)+\sum \limits_{j=1}^J{P}_{\mathrm{DG}}\left(j,t\right)+{P}_{\mathrm{WT}}\left(s,t\right)+{P}_{\mathrm{str}}\left(s,t\right)=\mathrm{Demand}(t)+{P}_{\mathrm{loss}}\left(s,t\right) $$
(10.13)

10.2.4.2 Wind, Diesel Generator, and Main Grid Power Limits in Each Hour

Each of the available distributed resources has a permissible range of power generation. Also, the transmission line between the MG and the main network has power constraints:

$$ {P}_{\mathrm{DG}}^{\mathrm{min}}\left(j,t\right)\le {P}_{\mathrm{DG}}(t)\le {P}_{\mathrm{DG}}^{\mathrm{max}}\left(j,t\right) $$
(10.14)
$$ 0\le {P}_{\mathrm{Wind}}(t)\le {P}_{\mathrm{Wind}}^{\mathrm{max}}(t) $$
(10.15)
$$ -{P}_{\mathrm{grid}}^{\mathrm{max}}(t)\le {P}_{\mathrm{grid}}(t)\le {P}_{\mathrm{grid}}^{\mathrm{max}}(t) $$
(10.16)

10.2.4.3 Ramp Rate Constraint

The thermal unit has a specific rate to increase or decrease power from hour to hour, and these problems should be taken into account in the planning of hourly power generation:

$$ {P}_{\mathrm{DG}}\left(t+1\right)-{P}_{\mathrm{DG}}(t)\le \mathrm{UR},\kern1em \mathrm{if}\kern1em {P}_{\mathrm{DG}}\left(t+1\right)>{P}_{\mathrm{DG}}(t) $$
(10.17)
$$ {P}_{\mathrm{DG}}(t)-{P}_{\mathrm{DG}}\left(t+1\right)\le \mathrm{DR},\kern0.5em \mathrm{if}\kern0.75em {P}_{\mathrm{DG}}(t)>{P}_{\mathrm{DG}}\left(t+1\right) $$
(10.18)

10.2.4.4 Minimum Up/Down Time Constraint

Economic planning requires that the thermal unit be shut off and re-illuminated within hours of the planning period for one or several hours. But the shutdown or re-illumination of these units is conditional on a certain period of time remaining in the state before the change.

$$ \left({T}_{\mathrm{ON},i}^{t-1}-{\mathrm{MUT}}_i\right)\times \left({s}_i^{t-1}-{s}_i^t\right)\ge 0\kern1em $$
(10.19)
$$ \left({T}_{\mathrm{OFF},i}^{t-1}-{\mathrm{MDT}}_i\right)\times \left({s}_i^t-{s}_i^{t-1}\right)\ge 0 $$
(10.20)

si is binary variable related to the status of the unit’s on or off.

10.2.4.5 Battery Limitation

The battery cannot be charged and discharged at any one time and has a limited charge and discharge range for 1 h, which two equations indicate:

$$ {P}_{\mathrm{str}}(t)<{P}_{\mathrm{ch}}^{\mathrm{max}} $$
(10.21)
$$ {P}_{\mathrm{str}}(t)<{P}_{\mathrm{dis}}^{\mathrm{max}} $$
(10.22)

The positive value Pstr indicates the discharge mode and its negative value indicates the battery charge status.

Also, the storage space is limited and the amount of charge and discharge per hour is proportional to the capacity of the battery:

$$ {E}_{\mathrm{stor}}(t)={E}_{\mathrm{stor}}\left(t-1\right)-{P}_{\mathrm{str}}(t)\kern1em $$
(10.23)
$$ {E}_{\mathrm{stor}}^{\mathrm{min}}\le {E}_{\mathrm{stor}}(t)\le {E}_{\mathrm{stor}}^{\mathrm{max}} $$
(10.24)

10.3 Solution Method

The optimization problem presented in the previous section is mixed integer nonlinear programming (MINLP) type, and it’s difficult to solve it with conventional and classical methods and it may not lead to the exact answer. Therefore, this paper uses the PSO method as one of the meta-heuristic methods for solving mixed-optimization problems.

PSO as a problem optimization technique is based on the intelligent motion of particles, which uses the concept of social behavior of some beings and stimulates them to solve optimization problems. This algorithm was introduced and developed in 1995 by James Kennedy and Russell Ebertard. Some of the benefits of this method make it different from other optimization techniques:

  • Multi-point search algorithm.

  • Easier implementation.

  • Faster calculations than other meta-heuristic algorithms.

  • Ability to solve objective functions with stochastic nature.

  • No need for a good initial solution to start the repeat process.

10.3.1 Particles Describing Equations

The motion of the particle in order to find the optimal solution is modeled as the following equations (10.25) and (10.26):

$$ {v}^i\left(t+1\right)=w\cdot {v}^i(t)+{c}_1{r}_1\cdot \left[{x}^{i,\mathrm{best}}(t)-{x}^i(t)\right]+{c}_2{r}_2\cdot \left[{x}^{\mathrm{gbest}}(t)-{x}^i(t)\right] $$
(10.25)
$$ {x}^i\left(t+1\right)={x}^i\ (t)+{v}^i\left(t+1\right) $$
(10.26)

where xi is the particle position; vi is the particle velocity; xi, best is the best position experienced by the particle; xgbest is the best position experienced among all particles (best particle); w, c1, c2 are the constant coefficients of PSO method; and r1, r2 are the stochastic values.

Binary PSO algorithm is introduced to address the deficiencies of the main algorithm of PSO and is used to solve the optimization problems with discrete search space. The equations for updating the velocity and position of each particle of this algorithm, which is also used in this paper with regard to the existence of binary variables, is according to the following Eqs. (10.27) and (10.28):

$$ {v}_{i,d}^{k+1}={v}_{i,d}^k+{c}_1{r}_1\left({p}_{i,d}^k-{x}_{i,d}^k\right)+{c}_2{r}_2\left({p}_{g,d}^k-{x}_{i,d}^k\right) $$
(10.27)
$$ {x}_{i,d}^k=\left\{\begin{array}{cc}1& {r}_3<\mathrm{sigmoid}\left({v}_{i,d}^k\right)\\ {}0& \mathrm{other}\end{array}\right. $$
(10.28)

In recent equations, \( {p}_{i,d}^k \) expresses the best position of the ith particle in repeating k and in the search space as large as d. r1, r2, and r3 are random numbers between 0 and 1 with uniform distribution. The sigmoid logic transform function is used to limit the velocity at a distance of [0,1] and is defined in the following equation (10.29):

$$ \mathrm{sigmoid}\left({v}_{i,d}^k\right)=\left\{\begin{array}{cc}\frac{2}{1+{\mathrm{e}}^{-{v}_{i,d}^k}}-1& -{v}_{i,d}^k\ge 0\\ {}1-\frac{2}{1+{\mathrm{e}}^{-{v}_{i,d}^k}}& -{v}_{i,d}^k\le 0\end{array}\begin{array}{c}\kern1.25em \\ {}\kern1em \end{array}\right. $$
(10.29)

According to the presented description, the flow chart of the method used in this research is to solve the MG scheduling optimization problem in accordance with Fig. 10.2. It is assumed that:

  • imax : The maximum number of PSO members

  • kmax : Maximum PSO iteration

  • PF: Power flow

  • Ci : The 24-h cost of the ith member, taking into account the different wind power scenarios and the main electricity grid

  • Cpb, i : The best (lowest) cost of the ith member

  • Ctb:The best (lowest) cost of all particles

  • Cgb: The final optimal cost

Fig. 10.2
figure 2

The flow chart of the method used to solve the MG scheduling optimization problem

10.4 Simulation Result

In this section to examine the results of the performance of the model and the proposed method, the IEEE 33-bus test radial distribution network has been used. To convert the distribution system into an MG connected to the main grid after reducing the load scale and increasing the impedance of the grid lines, in such a way that the network voltage and load profiles are exactly the same as their previous and standard state, a series of distributed energy resources and storage equipment have been used. The technical and economic features of the distributed units used are shown in Table 10.1:

Table 10.1 The technical and economic features of the distributed units

After installing each of the scattered resources, the MG is operated as follows (Fig. 10.3):

Fig. 10.3
figure 3

IEEE 33-bus radial distribution system

In the desired MG, the maximum consumption during the planning period is 371.5 kW and the minimum is 99.885 kW. The daily consumption forecast curve for this MG is as shown in Fig. 10.4:

Fig. 10.4
figure 4

The daily consumption forecast curve

Figure 10.5 shows the impact of DR programs on the load curve, assuming a maximum firm commitment of 30%.

Fig. 10.5
figure 5

The impact of DRPs on the load curve

As shown, the amount of power consumed at the peak time is reduced, and some amount of power is transferred to the off-peak time, which depends on the amount of the transfer to the price change at different times, the demand pull matrix, and the degree of participation in these programs. The effect of implementing these programs on the cost function, the planning of the power of distributed units, the amount of power exchange with the upstream network, the load profile, and the losses of the MG are the objectives of the implementation of these programs in this paper.

The predicted energy market price for a particular day, as predicted by Ref. [9], is given in Table 10.2. Also, the average wind speed curve for a particular day in the same reference is shown in Fig. 10.6.

Table 10.2 The daily predicted energy market price
Fig. 10.6
figure 6

The average wind speed curve

In order to evaluate the results and performance of the proposed model and method, the simulation results are analyzed for the four scenarios (Sects. 10.4.1, 10.4.2, 10.4.3, and 10.4.4):

10.4.1 Utilization Planning Without Consideration of Uncertainty and DR

In this case, all predicted parameters such as wind speed, energy cost, and load are assumed definitively and loads are nonresponsive. Figure 10.7 shows the power distribution between distributed units, the amount and time of charge or discharge of the battery, and the way of power exchange with the main network for this state:

Fig. 10.7
figure 7

Optimal power distribution of the MG resources in scenario A

According to Fig. 10.7, in the early hours when the electricity price is lower than peak times, the diesel unit is turned off and power is generated by the network and the other unit, and during high-cost network hours, the diesel unit can be switched on and output, and the amount of purchase from the network has dropped due to its high price, and even the surplus of dispersed and storage units can be sold to the network. The optimal utilization cost for daily planning and the amount of loss during the planning period is presented in Table 10.3.

Table 10.3 The daily optimal operation cost and loss

Figure 10.8 shows the convergence of the proposed method in finding the optimal cost after repeated repetitions.

Fig. 10.8
figure 8

The convergence of the proposed method

It should be noted that in the different setup of the program using the MATLAB software and the method described, this value is very low tolerance and can be neglected, and this small amount is also due to the random nature of the method.

The battery used in this grid has a maximum charge and discharge power of 12 kW/h and can store up to 65 kWh and at least 5 kWh of energy. Figures 10.9 and 10.10, respectively, indicate the amount of charge or discharge power and the percentage of available energy of the battery as compared to its maximum storage space per hour of the scheduling period.

Fig. 10.9
figure 9

The amount of charge or discharge power of the battery in scenario A

Fig. 10.10
figure 10

The percentage of available energy of the battery in scenario

As shown in Fig. 10.9, the battery is charged at off-peak hours and discharged at peak times when the energy price is high and is considered as a source of production.

As noted above, the planning has been carried out with due observance of different constraints. One of the important constraints in the planning of power output in the MG is to consider the non-violation of the voltage value as a technical limit is within the permissible range of 5% of the slack bass voltage. Figure 10.11 shows the bass voltages per hour of the scheduling period as prionite.

Fig. 10.11
figure 11

The bass voltages per hour of the scheduling period in scenario A

As shown in Fig. 10.11, the voltage curve has not exceeded the permissible limit in any of the 24-h scheduling periods.

10.4.2 Utilization Planning Without Consideration of Uncertainty and Presence of DR

In this case, consumers are sensitive to price changes at different times. As a result, with rising prices at peak hours, consumption is reduced during these hours or part of it is transferred to off-peak times. Figures 10.12 and 10.13, respectively, compare the cost of operation and the casualties of this mode with the operating mode without DR:

Fig. 10.12
figure 12

Comparison of the cost of operation in the with and without DRPs (scenario A and B)

Fig. 10.13
figure 13

Comparison of transmission line losses in the with and without DRPs (scenario A and B)

It can be seen that the implementation of these programs reduces the cost of exploitation and losses of the MG lines.

The curve of Fig. 10.14 clearly shows that the cost of utilization in peak times during the implementation of load response programs has declined, and because of the price drop in peak hours and the shift in part of the consumption to these hours, the cost of these hours has gone up modestly.

Fig. 10.14
figure 14

Comparison of the operating cost per hour of the scheduling period with and without DRPs

In this case, optimal scheduling requires that the power transmission be carried out in such a way that, besides changing the values of the diesel unit and the battery, in the first priority, the purchase of the upstream network will be reduced due to its high price and this is seen in the following results. The status of charge and discharge of the battery and the amount of energy in the battery with the same previous information, with a slight increase in the charge amount at off-peak hours and increasing the amount of discharged at peak times, are in accordance with Figs. 10.15 and 10.16, respectively.

Fig. 10.15
figure 15

The amount of charge or discharge power of the battery in scenario B

Fig. 10.16
figure 16

The percentage of available energy of the battery in scenario B

By implementing responsive programs and changing the load profile and distributing power between resources, new programming should not cause voltage curves to run out of range and Fig. 10.17 confirms this problem.

Fig. 10.17
figure 17

The bass voltages per hour of the scheduling period in scenario B

10.4.3 Utilization Planning with Consideration of Uncertainty and Lack of DR

In this case, the results are based on the implementation of stochastic formulation. Each of the uncertainty parameters has a certain amount of predicted error relative to their values in the two previous states, which consider these errors leading to different scenarios of the values of these parameters. Eventually, the uncertainty is covered by providing randomized planning based on existing scenarios. Figure 10.18 shows the power distribution between the units available for this mode of operation. It can be argued that by applying this insufficiency, the amount of MG dependence has increased to buy power from the main grid. The reason for this increase in purchases from the main network and the relative decline in purchases from diesel generators can be seen at the high cost of generating diesel generator power due to higher fuel costs than the cost of purchasing power from the main network.

Fig. 10.18
figure 18

Optimal power distribution of the MG resources in scenario C

Figures 10.19 and 10.20 show the comparison of cost and casualties in two definitive and randomized operation models without considering the DR.

Fig. 10.19
figure 19

Comparison of the cost of operation in the definitive and stochastic programming

Fig. 10.20
figure 20

Comparison of the transmission losses in the definitive and stochastic programming

This increase is reasonable in a randomized operation model that is more stable and more reliable under conditions of uncertainty of renewable resources, load, and network costs. Also, the amount of grid losses in this case has also increased due to the relative increase in unit production due to wind power error and consumer load.

Stochastic operation under the conditions of different scenarios of the irregular parameters should not increase or drop excess network voltages, as shown in Fig. 10.21 of this claim.

Fig. 10.21
figure 21

The bass voltages per hour of the scheduling period in scenario C

10.4.4 Operational Planning with Consideration of Uncertainty and DR

In this case, by executing responsive programs, optimal cost utilization and losses changes, along with the coverage of uncertainty parameters, are investigated. Figures 10.22 and 10.23 show, respectively, the changes in the production capacity of a diesel unit and the main network in a random mode with presence of DRPs compared to a without DRPs mode.

Fig. 10.22
figure 22

The changes in the production capacity of a diesel unit in operation mode with and without DRPs

Fig. 10.23
figure 23

The changes in the production capacity of a diesel unit in operation mode with and without DRPs

According to these comparisons, at peak times, the dependence of the MG on the diesel unit is higher than the main grid because of its higher price, and the amount of purchase from the main grid at these times has significantly decreased. Also, due to lower prices during off-peak hours as a result of the implementation of these programs, the amount of injected power of the network is slightly increased and the diesel unit in these hours is off because of the high cost of fuel than to buy power from the main network. These changes in resource generation reduce the optimal cost as well as the network losses and Figs. 10.24 and 10.25 illustrate this issue, respectively.

Fig. 10.24
figure 24

Comparison of the cost of operation in the with and without DRPs (scenario C and D)

Fig. 10.25
figure 25

Comparison of transmission line losses in state with and without DRPs (scenario C and D)

Figures 10.26 and 10.27 show, respectively, optimal cost values and network losses in four different scenarios to determine the best operating conditions from the operator’s perspective.

Fig. 10.26
figure 26

Comparison of optimal cost of four different exploitation scenarios

Fig. 10.27
figure 27

Comparison of transmission losses of four different exploitation scenarios

As the figures show, running DRPs, both in certain mode operation and stochastic operation, leads to a reduction in optimal utilization costs and grid losses, and this shows the necessity of implementing these programs in the planning of this MG. On the other hand, while the definitive mode of operation, taking into account DRPs relative to random operation mode, is about 12.5% less cost and about 4.5% fewer casualties, but this is reasonable and justified way due to considering and covering the uncertainty of renewable energy sources, the amount of MG load, and network price, in stochastic mode. Therefore, planning with the consideration of DRPs and uncertainty is the most economical planning in real terms.

10.5 Conclusion

Considering the importance and development of MGs in the distribution network, it is important to develop and improve their utilization planning. In this regard, this paper presents optimal operational planning of an MG connected to the upstream network, taking into account the losses of transmission lines and the implementation of the demand response program, under the conditions of uncertainty of renewable resources, the amount of consumption, and the price of energy. The operator’s goal is to reduce the cost of supplying power to feed the grid load, under the conditions of different constraints of production units, technical and network, also part of this cost related to the losses of transmission lines. The duration of the MG operation planning is 24 h. Also, the impact of the DRPs of the optimal utilization cost, the MG losses, and the planned power of the MG components is analyzed. To simulate and evaluate the results, four different scenarios of exploitation have been studied. Numerical results show that by executing the DRP, the cost of power supply and the losses of the MG are reduced. However, in the case of stochastic operation and under uncertainty conditions, the cost of exploitation and losses are more than definitive utilization mode and without considering the uncertainty. However, these increases seem to be reasonable, due to the consideration and coverage of these uncertainties. Finally, according to the results, it was suggested that from the operator’s point of view, the most appropriate scenario is the planning of exploitation in the presence of the DRPs and taking into account the uncertainty.