1 Introduction

The high growth of distribute energy resources (DERs) penetration into medium voltage (MV) distribution networks has caused the distribution system operators (DSOs) to face some management, economic and technical issues. In the near future, in order to technically and economically manage the electrical networks, DSOs will be forced to set up marketplaces in which DERs will able to sell their active and reactive powers [1, 2]. It means that an effective market operation is required for achieving an economic equilibrium to promote DERs integration [2]. In [3], a market-oriented method has been proposed to integrate an economical portfolio of DERs, storage systems and demand response as the network resources. An energy management problem in a smart grid containing DERs and responsive demands has been addressed in [4], in which an incremental welfare consensus algorithm has been introduced to solve the problem in a distributed and cooperative manner. In distribution networks, it has been paid less attention to the reactive power market and hence, there are few researches focusing on this issue [5,6,7]. In [5], a control framework has been presented that allows DER owner to attain benefits through offering the ancillary service of voltage regulation to the DSO and maximizing the production of its active power. A mixed integer convex programming model is adopted to solve the reactive power dispatch problem in a distribution network populated with DERs [6]. It has used a conic relaxation based on a branch flow formulation.

Regarding the research works on wholesale markets, the active and reactive power markets are cleared based on the both simultaneous and separate models [8]. In the separate model, first, the active power dispatches of producers are attained in the energy market and the obtained results are passed as inputs for clearing the reactive power market. In the simultaneous model, the active and reactive powers of producers are simultaneously dispatched. Because the active and reactive power of generators are correlated through their capability curves, the solutions of the simultaneous model are theoretically closer to the optimum in comparison with those achieved from the decoupled one [9, 10]. Some research papers have focused on the relationship between active and reactive powers during clearing of the reactive power market [11,12,13].

An important issue for reactive power pricing is to consider the lost revenue of generators due to reduced active power production. This lost revenue is called lost opportunity cost (LOC) [8, 14,15,16,17]. A coupled market in the presence of plug-in electric vehicles (PEVs) has been proposed in [15]. The considered objective function that is minimized comprises offer costs related to energy market, total reactive power payments function and LOCs. A new paying structure of the LOC to the producers of the reactive power has been presented in [16] aiming at improving the coupled energy and reactive markets. The capability curve of synchronous generators has been used to carefully model the cost of production or absorption reactive power which includes availability cost, losses cost and LOC [17]. To the best of our knowledge, in distribution markets, no compensation term has yet considered for the lost cost of the sale energy opportunity of DGs due to the production or absorption of reactive power.

Existence of significant levels of uncertain parameters is one of the major problems in decision-making process in power systems. Nowadays, the portion of energy generation from renewable resources such as wind and solar are growing and the intermittent nature of such resources is one of the main reasons for uncertainty. Meanwhile, load requirements and electricity prices can be considered as uncertain parameters. Generally, the uncertain parameters have limitless realizations and it is impossible to involve all of them in the decision-making process. In scenario-based decision-making methods, the realization space is approximated by limited scenarios with particular probabilities. Indeed, a set of scenarios is generated using probability density function (PDF) of the uncertain parameters. Although, the unlimited space of the uncertain parameters is transformed into an approximated one, these methods are efficient and simple to be performed [18]. A stochastic framework has been proposed to manage microgrids (MGs) in [19]. Firstly, a list of scenarios has been generated using the PDF of each uncertain parameter as well as roulette wheel mechanism (RWM), and secondly, in the scenario reduction process, for less computation, the most probable scenarios have been selected to remain. In each scenario, an adaptive modified firefly algorithm (AMFA) has been employed to solve the problem. In [20], a more comprehensive research work in comparison with the former, an improved multi-objective teaching-learning algorithm has been implemented to manage MGs. In [21], a stochastic bidding strategy of MGs in a coupled day-ahead energy and spinning reserve market has been proposed taking into account the uncertainties of renewable powers and loads. To do this, MG active power generation scenarios have been generated based on Latin hypercube sampling (LHS) technique and then reduced by backward method of the scenario reduction [21]. With this understanding, we need an efficient stochastic framework to cope with such uncertainties.

A distribution system is usually operated in a radial configuration, which comprises lines with relatively high resistance. Hence, active power dispatch of DGs in an ADN has considerably impact on buses voltage. Moreover, reactive power output of a generator correlates highly with active power through the capability curve. With this background, the separate active and reactive power dispatch scheduling that is prevalent in power systems can lead to non-optimal solution.

In this paper, a new stochastic market-based model for simultaneous day ahead active/reactive power dispatch scheduling are presented aiming at achieving coordinated volt/var control for ADNs. In the proposed model, distribution company (DisCo) is an intermediate entity between wholesale market and distribution system. DisCo purchases energy and reactive power from upstream market and sells them to the DSO via proposed distribution market. In the proposed model, unlike separate reactive power market, the LOC payment is not taken into consideration. Instead, a new payment index as loss profit value (LPV) is introduced and embedded in the model for a DG unit. It compensates for possible financial detriment arising from the reduction in energy sales profit in simultaneous market compared to the separate energy market. The uncertain parameters containing the output power of renewable energy resources including wind turbines (WTs) and photovoltaic (PV) units, wholesale active and reactive prices are considered. The scenario-based stochastic method is employed to approximate continuous environment of uncertain parameters. In this regard, in the phase of scenarios list generation, lattice Monte Carlo simulation (LMCS) and RWM are adopted to generate scenarios based on the PDF of uncertain parameters. Then, in the scenario reduction phase, the most probable and dissimilar scenarios are selected. The proposed probabilistic simultaneous active/reactive scheduling framework is modeled through a mixed-integer nonlinear optimization program implemented in generalized algebraic modeling systems (GAMS) software and solved with the DICOPT optimization solver.

The main innovative contributions of the paper can be summarized as follows:

  1. 1)

    A probabilistic simultaneous active/reactive scheduling model that corresponds to ADNs is introduced.

  2. 2)

    The uncertainties of renewable energy resources, wholesale active and reactive power prices are considered.

  3. 3)

    A new index as loss profit value (LPV) term is formulated and added to the cost objective function of the model to minimize the profit difference of the DGs that they could gain in both simultaneous and separate markets.

The remainder of this paper is organized as follows. Scenario-based stochastic modeling is described in Section 2. In Section 3, the proposed stochastic simultaneous active/reactive power management is formulated. Numerical studies of the proposed modeling are implemented and analyzed in detail in Section 4 and finally, Section 5 is devoted to the conclusion.

2 Scenario-based stochastic modeling

2.1 Scenario generation and reduction

The existing errors in the power generation forecasting of PV and WT units can be demonstrated as a PDF of the forecasting errors [22]. As exhibited in Fig. 1, the PDF is divided into some discrete levels. Each level demonstrates a particular error value with its probability in the forecasted parameter. In order to create scenarios by applying RWM, all probabilities of different levels should be normalized so that their summation is equal to one. The accumulated normalized probabilities of discrete levels are plotted in Fig. 2. Considering the discrete levels and their corresponding probabilities, RWM are utilized to create a limited set of scenarios. Scenarios can reflect the different realization of the uncertain parameters. To extract some random scenarios from the discrete levels of PDFs of uncertain parameters, the RWM and LMCS method are applied [23]. By means of these scenarios, the probabilistic programming problem is converted to some different deterministic problems that have different probabilities of occurrence.

Fig. 1
figure 1

Typical PDF discretization of forecasting errors

Fig. 2
figure 2

RWM for the normalized forecasting errors

To generate a certain number of scenarios, first, a random number over the path between 0-1 is individually generated and assigned to each uncertain parameter for each hour. Based on the roulette wheel level in which the assigned random number locates, the RWM opts the corresponding predicting error as a scenario for the uncertain variable. At each hour of the optimization time horizon, a scenario is attained by a mixture of the created scenarios by RWM for forecasting errors of output power of renewable energy resources as well as wholesale active and reactive prices. Here, instead of ordinary Monte Carlo simulation (MCS), LMCS technique is employed to generate random numbers. In LMCS, an N-point lattice rule of rank-r in d-dimension is computed as follows [20]:

$$\begin{array}{*{20}l} {\mathop \sum \limits_{p = 1}^{r} \left( {\frac{{k_{p} }}{{n_{p} }}\mathop \sum \limits_{q = 1}^{N} V_{q} } \right) {\text{mod}} 1 } \hfill & {k_{p} = 1,2, \ldots ,N} \hfill \\ {} \hfill & {p = 1,2, \ldots ,r} \hfill \\ \end{array}$$
(1)

where \(V_{1} ,V_{2} , \ldots , V_{N}\) are vectors with dimension d generated by the ordinary MCS, dimension d is the number of random variables for each scenario. A LMCS scenario is created using a set of values\(\left\{ {k_{p} , p = 1,2, \ldots ,r} \right\}\). Therefore, the LMCS procedure produces N scenarios. However, the N scenarios produced by means of LMCS are more uniformly distributed rather than the original N scenarios attained by the ordinary MCS. \(n_{1} , n_{2} , \ldots ,n_{r}\) indicate set points of the LMCS and are input data of this technique.

To alleviate computational burden and complexity of this approach, a proper scenario reduction technique should be employed. Here, the considered scenario reduction is aimed at removing the similar scenarios along with the scenarios with low probability. After the implementation of the scenario reduction, Ns scenarios with the most probable and dissimilar scenarios are selected. The length of each selected scenario is the number of uncertain parameters. The scenario s for NRes of renewable energy sources (RES)-based DGs (RES-DGs) including WT and PV units at hour h is written as follows:

$$S_{s} = \left[ {P_{DG,1,s}^{F,h} ,P_{DG,2,s}^{F,h} , \ldots ,P_{{DG,N_{Res} ,s}}^{F,h} , B_{DisCo,s}^{h} ,\rho_{Q,DisCo,s}^{h} } \right]$$
(2)

where \(P_{DG,w,s}^{F,h} \left( {w = 1,2, \ldots , N_{Res} } \right)\), \(B_{DisCo,s}^{h}\) and \(\rho_{Q,DisCo,s}^{h}\) are the forecasted active power of RES-DG w, energy and reactive power price of upstream grid offered by DisCo in scenario s and hour h, respectively; NRes is the total number of RES-DGs. Considering a seven level-PDF as illustrated in Fig. 1, the probability of scenario s,\(\pi_{s}\), can be calculated as (3), where \(Z_{kw,h,s}^{DG}\), \(Z_{kP,h,s}^{B}\) and \(Z_{kQ,h,s}^{\rho }\) are binary numbers signifying the selection status of the kw-th level of RES-DG power, the kP-th level of energy price and kQ-th level of reactive power price of upstream grid in the hour h and scenario s, respectively; βkw,h, βkP,h and βkQ,h denote the probability of kw-th level of RES-DG power, kP-th level of energy price and kQ-th level of reactive power price of upstream grid at hour h, respectively.

$$\begin{aligned} \pi_{s} = \frac{{\mathop \prod \limits_{h = 1}^{24} \left( {\left( {\mathop \sum \limits_{kw = 1}^{7} Z_{kw,h,s}^{DG} \cdot \beta_{kw,h} } \right)\left( {\mathop \sum \limits_{kP = 1}^{7} Z_{kP,h,s}^{B} \cdot \beta_{kP,h} } \right)\left( {\mathop \sum \limits_{kQ = 1}^{7} Z_{kQ,h,s}^{\rho } \cdot \beta_{kQ,h} } \right)} \right)}}{{\mathop \sum \limits_{s = 1}^{{N_{s} }} \mathop \prod \limits_{h = 1}^{24} \left( {\left( {\mathop \sum \limits_{kw = 1}^{7} Z_{kw,h,s}^{DG} \cdot \beta_{kw,h} } \right)\left( {\mathop \sum \limits_{kP = 1}^{7} Z_{kP,h,s}^{B} \cdot \beta_{kP,h} } \right)\left( {\mathop \sum \limits_{kQ = 1}^{7} Z_{kQ,h,s}^{\rho } \cdot \beta_{kQ,h} } \right)} \right)}}&\quad \forall s = 1,2, \ldots ,N_{s} \end{aligned}$$
(3)

2.2 Scenario aggregation

To achieve an optimal solution for all selected scenarios, the scenario aggregation technique is utilized. All optimal solutions of scenarios are combined based on the probabilities of scenarios and the expected result of the stochastic problem is found. If the optimal solution set of each scenario represents by Xs, the “expected value” of the control variable X can be defined as [19, 24]:

$$X = \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} X_{s}$$
(4)

3 Proposed stochastic simultaneous active/reactive power management

Here, a simultaneous active/reactive market model at distribution level is explained. The structure of proposed simultaneous active and reactive scheduling is based on the pool market within the DSO runs this market. In this model, it is supposed that the all DGs including dispatchable DGs and RES-DGs (WTs and PVs) are assumed to be competitive agents in the market. In the presented market model, the DSO, which acts as the distribution market operator, manages the operational facilities and buying energy and/or reactive power from all types of DGs through the pool contracts and/or the wholesale electricity market. Dispatchable DGs and RES-DG units transfer bids prices of active/reactive power in the form of multi-block to the distribution market for each hour of the next day. Then, the DSO runs an optimization problem in order to minimize the cost of energy and reactive power. After receiving active and reactive bids of DGs, active and reactive power prices of upstream wholesale market through DisCo, the DSO performs the simultaneous active/reactive power (P-Q) dispatch scheduling scheme. It is worth mentioning that the proposed day-ahead simultaneous market in distribution system is executed before the wholesale market. Illustrative structure of presented simultaneous market in relation with separate energy market is plotted in Fig. 3. As depicted in the Fig. 3, the initial separated active power dispatch results and market clearing price (MCP) of separate energy market model are given to the simultaneous P-Q scheduling model to calculated the LPV index.

Fig. 3
figure 3

Illustrative structure of simultaneous P-Q market and its relation with separate energy market

In order to handle the uncertainties of output power generation of WT and PV units as well as the energy and reactive power prices of upstream grid in the simultaneous active/reactive power scheduling problem, a two-stage stochastic programming framework is adopted. In the first stage of the proposed stochastic scheduling, different scenarios corresponding to the uncertain parameters during 24 h scheduling period are generated by a RWM and LMCS method. Moreover, in this stage, to mitigate the complexity and computational burden and to improve the performance of the presented model, a proper scenario reduction procedure is utilized. In the second stage, the simultaneous active/reactive power scheduling model is executed based on the selected scenarios (after applying scenario reduction method) as a mixed-integer nonlinear optimization problem (MINLP) optimization problem according to the occurrence probability of scenarios.

3.1 Objective function

The objective function (OF) of the proposed stochastic simultaneous market is expressed as the minimization of expected total payments by DSO to generation units. These payments consist of energy costs of DGs, reactive power costs of DG including availability and losses costs, total costs of energy and reactive power procured by DisCo from upstream market and total cost of LPV paid to DG owners. Consequently, the mathematical formulation of the stochastic simultaneous market-clearing problem can be defined as follows:

$${ \hbox{min} }\, OF = EC_{E} + EC_{Q,DG} + EC_{Q,DisCo} + ELPV_{DG}$$
(5)

where ECE is expected value of total energy costs of DGs and bid price of DisCo for procurement of energy from upstream grid during the whole scheduling horizon; ECQ,DG is the expected total reactive power cost function of DGs; ECQ,DisCo is the expected price of reactive power received from the upstream grid; ELPVDG is the expected total LPV cost of DGs over a 24 h operation period in the simultaneous P-Q market.

Different portions of (5) of stochastic simultaneous active/reactive power scheduling are explained in the following.

3.1.1 Expected value of total energy costs

ECE is calculated as follow:

$$\begin{aligned} EC_{E} & = \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} \left( \mathop \sum \limits_{h = 1}^{24} P_{DisCo,s}^{h} B_{DisCo,s}^{h} + \mathop \sum \limits_{h = 1}^{24} \mathop \sum \limits_{j = 1}^{{N_{SG} }} \mathop \sum \limits_{b = 1}^{{N_{b} }} P_{DG,j,b,s}^{h} B_{DG,j,b}^{h}\right. \\ &\quad \left.+ \mathop \sum \limits_{h = 1}^{24} \mathop \sum \limits_{w = 1}^{{N_{Res} }} P_{DG,w,s}^{h} B_{DG,w}^{h} \right)\end{aligned}$$
(6)

where \(P_{DisCo,s}^{h}\) is scheduled purchased active power from the upstream grid at hour h in scenario s; \(P_{DG,j,b,s}^{h}\) represents the accepted active power of dispatchable DG j in offer block b, in scenario s and hour h in the simultaneous market; \(P_{DG,w,s}^{h}\) is the accepted active power of RES-DG w in scenario s and hour h. In this paper, it is assumed that the indices j and w are used for dispatchable DG and RES-DG, respectively. \(B_{DisCo,s}^{h}\), \(B_{DG,j,b}^{h}\) and \(B_{DG,w}^{h}\) represent energy bid price of upstream grid offered by DisCo at hour h in scenario s, bid price of energy by dispatchable DG j in offer block b at hour h and bid price of energy by RES-DG w at hour h, respectively; \(N_{SG}\) and Nb are the total numbers of dispatchable DGs and offer blocks of dispatchable DGs for energy, respectively. In the simultaneous market, the DGs usually bid in the market in the form of a multi-block offer as given in (6). Here, it is assumed that the DG unit submits its selling bid price based on the active power marginal cost. In the proposed model, it is assumed that the RES-DGs bid for energy with one-block offers based on the hourly forecasted active power.

3.1.2 Expected total cost function of reactive power of DGs

In ADNs, DGs can be divided into two categories from the viewpoint of the connectivity to the network. The first one includes synchronous generator (SG)-based DGs (e.g. biomass generator units and gas turbines (GTs)) that are integrated into the distribution grids without power electronic convertors [25, 26]. Conversely, the DGs of the second type, i.e., inverter based-DGs (e.g., fuel cells (FCs), micro turbines (MTs) and WTs) are installed to the grids by means of power electronic interfaces [5]. The capability curve of a SG-based DG is depicted in Fig. 4 [7]. The reactive power capability limits of this generator can be determined according to the armature current limit, rotor field current limit, prime mover limit and stability limit [7]. On the other hand, the maximum current and voltage of converters impose limitations on the reactive power capability of the inverter based DGs. In steady state, the capability curve of a WT is obtained by considering the steady state stability limit, as the third limitation factor, that demonstrates the maximum absorbable reactive power. A typical capability diagram of an inverter based DG is depicted in Fig. 5 [7].

Fig. 4
figure 4

Capability curve of a SG-based DG

Fig. 5
figure 5

Capability curve of an inverter based DG

In most of distribution systems, the DSO enters into contracts with DGs that are demanded to provide a minimum reactive power support. Here, we assumed that the DG units must operate between a mandatory leading and lagging power factor \(\cos (\varPhi_{mnd } )\) at every operation points [7]. By considering the explanations and using the capability curve of the DG, a three-component reactive power pricing structure is extracted as described in the following. At an assumed active power PDG,i, we can distinguish three operation sections for reactive power of the DG as follows [27]:

Section 1 (\(- Q_{DG,i}^{mnd}\) to \(Q_{DG,i}^{mnd}\)): The reactive power of this section is according to the minimum reactive power support requirement. In this section, the DSO pays the DG only by an availability price (ρ0) in $/h being a fixed component.

Section 2 (\(Q_{DG,i}^{\hbox{min} }\) to \(- Q_{DG,i}^{mnd}\)) and Section 3 (\(Q_{DG,i}^{mnd}\) to QA,i): In these sections, the DG provides an extra amount of reactive power beyond the Section 1, without requiring the adjustment its scheduled active power. Since the windings losses increase, the DG should be paid the cost of the losses for its reactive power service. Therefore, the reactive power cost function in Sections 2 and 3 should cover the losses cost besides the availability cost. We define a couple losses pricing components as price ρ1 in $/Mvarh for Section 2 and price ρ2 in $/Mvarh for Section 3 [28], respectively.

Accordingly, the reactive power cost function of DG i denoted by QCDG,i for the simultaneous P-Q scheduling model is presented as follows:

$$QC_{DG,i} = W_{0,i} \rho_{0,i} + W_{1,i} \left( {\rho_{0,i} - \rho_{1,i} \left( {Q_{1,DG,i} + Q_{DG,i}^{mnd} } \right)} \right) + W_{2,i} \left( {\rho_{0,i} + \rho_{2,i} \left( {Q_{2,DG,i} - Q_{DG,i}^{mnd} } \right)} \right)$$
(7)
$$Q_{DG,i}^{ \hbox{min} } \le Q_{1,DG,i} \le - Q_{DG,i}^{mnd}$$
(8)
$$Q_{DG,i}^{mnd} \le Q_{2,DG,i} \le Q_{A,i}$$
(9)

where ρ0,i, ρ1,i and ρ2,i are the reactive bid values of DG i for the proposed market-based model; \(W_{0,i} , W_{1,i}\), W2,i are binary variables; \(Q_{DG,i}^{ \hbox{min} }\) is the minimum reactive power of DG i. These variables implicate a section that a DG can operate in it. Based on (7), \(EC_{Q,DG}\) for all types of DGs that incorporate in the voltage and reactive power control scheme is given as:

$$\begin{aligned} &EC_{Q,DG} = \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} \left(\mathop \sum \limits_{i = 1}^{{N_{DG} }} \mathop \sum \limits_{h = 1}^{24} \left( W_{0,i,s}^{h} \rho_{0,i} + W_{1,i,s}^{h} \left(\rho_{0,i} - \rho_{1,i} \left( Q_{1,DG,i,s}^{h} + Q_{DG,i,s}^{mnd,h} \right) \right)\right.\right.\\ &\quad \left.\left.+W_{2,i,s}^{h} \left(\rho_{0,i} + \rho_{2,i} \left( {Q_{2,DG,i,s}^{h} - Q_{DG,i,s}^{mnd,h} } \right) \right) \right)\vphantom{\mathop \sum \limits_{i = 1}^{{N_{DG} }}}\right) \end{aligned}$$
(10)

where NDG is the total number of DGs including dispatchable DGs and RES-DGs (\(N_{DG} = N_{SG} + N_{Res}\)); \(W_{0,i,s}^{h} , W_{1,i,s}^{h}\)and \(W_{2,i,s}^{h}\) are binary variables related to reactive power cost function of DG i in scenario s and hour h; \(Q_{1,DG,i,s}^{h}\) and \(Q_{2,DG,i,s}^{h}\) are scheduled purchased reactive power from DG i at hour h in scenario s; \(Q_{DG,i,s}^{mnd,h}\) is maximum mandatory reactive power of DG i at hour h in scenario s.

According to (8) and (9), the operation constraints of DG i associated to reactive power provision are defined as:

$$- W_{0,i,s}^{h} Q_{DG,i,s}^{mnd,h} \le Q_{0,DG,i,s}^{h} \le W_{0,i,s}^{h} Q_{DG,i,s}^{mnd,h}$$
(11)
$$W_{1,i,s}^{h} Q_{DG,i}^{min} \le Q_{1,DG,i,s}^{h} \le - W_{1,i,s}^{h} Q_{DG,i,s}^{mnd,h}$$
(12)
$$W_{2,i,s}^{h} Q_{DG,i,s}^{mnd,h} \le Q_{2,DG,i,s}^{h} \le W_{2,i,s}^{h} Q_{A,i,s}^{h}$$
(13)
$$Q_{DG,i,s}^{mnd,h} = \left( {P_{DG,i,s}^{h} } \right){ \tan }\left( {{ \arccos }\left( {\varPhi_{mnd} } \right)} \right)$$
(14)
$$Q_{DG,i,s}^{h} = Q_{0,DG,i,s}^{h} + Q_{1,DG,i,s}^{h} + Q_{2,DG,i,s}^{h}$$
(15)
$$W_{0,i,s}^{h} + W_{1,i,s}^{h} + W_{2,i,s}^{h} \le 1$$
(16)
$$W_{0,i,s}^{h} , W_{1,i,s}^{h} , W_{2,i,s}^{h} \in \left\{ {0,1} \right\}$$
(17)

where \(Q_{A,i,s}^{h}\) which lies on the Q capability margin is achieved according to the output power of DG i at hour h in scenario s, i.e. \(P_{DG,i,s}^{h}\) [7]. Equations (16) and (17) guaranty that each DG can operate in only one of the three pre-defined sections.

3.2 Expected total cost of reactive power purchased from the upstream grid

In the wholesale reactive power market at power systems, the DisCO will pay the cost of reactive power received from the upstream grid to the independent system operator (ISO). Hence, \(EC_{Q,DisCo}\) is as follow:

$$EC_{Q,DisCo} = \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} \left( {\mathop \sum \limits_{h = 1}^{24} \left| {Q_{DisCo,s}^{h} } \right| \rho_{Q,DisCo,s}^{h} } \right)$$
(18)

where \(Q_{DisCo,s}^{h}\) and \(\rho_{Q,DisCo,s}^{h}\) are scheduled purchased reactive power from upstream grid and the reactive power price of DisCo at hour h in scenario s, respectively.

3.3 Expected total LPV of DGs

In the separate reactive power market, if a DG is needed to reduces its active power output that formerly is determined in the separate energy market to provide required reactive power of system, the LOC cost is paid. Nevertheless, if active power dispatch schedule of a DG in the proposed simultaneous energy and reactive market is less than the corresponding one in the separate energy market, the DG is not paid the LOC cost. Therefore, the reactive power cost function of DG units includes only availability and losses costs. A DG might receive lower profit of energy sale when it participates in the simultaneous market compared to the separate energy market. LPV index which is paid by DSO to the DG owner compensates for this probable lost revenue arising from reduced energy sale profit. Thus, the LPV payment for each DG unit is defined as the difference of profit value that a DG can receive from energy production in separate market and simultaneous market. Here, it is assumed that the DG unit submits its selling bid price based on the active power marginal cost. In deterministic approach, the LPV index for a DG is formulated based on the difference of active power production by the DG in the separate energy market and simultaneous market, and the MCP of these two markets as follows.

For dispatchable DG j, the LPV index is defined as:

$$\begin{aligned} LPV_{DG,j}^{h} & = \hbox{max} \left\{ 0,\left(\mathop \sum \limits_{b = 1}^{N_{b}} \left({MCP_{sep}^{h} -B_{DG,j,b}^{h} } \right)P_{DG,j,b}^{sep,h}\right. \right. \\ & \qquad \left.\left.- \mathop \sum \limits_{b = 1}^{N_{b} } \left( MCP_{sim}^{h} - B_{DG,j,b}^{h} \right)P_{DG,j,b}^{h} \right)\right\} \end{aligned}$$
(19)

where the maximum selling bid price accepted at each hour indicates the hourly MCP; \(MCP_{sep}^{h}\) and \(MCP_{sim}^{h}\) are MCP in the separate energy market and simultaneous market at hour h, respectively; \(P_{DG,j,b}^{sep,h}\) and \(P_{DG,j,b}^{h}\) are accepted active power of dispatchable DG j in offer block b and hour h in separate energy market and simultaneous market, respectively.

For RES-DG w:

$$\begin{aligned} LPV_{DG,w}^{h}& = \hbox{max} \left\{0,\left( \left( {MCP_{sep}^{h} - B_{DG,w}^{h} } \right)P_{DG,w}^{sep,h}\right. \right.\\& \quad\left.\left. - \left( {MCP_{sim}^{h} - B_{DG,w}^{h} } \right)P_{DG,w}^{h} \right) \right\} \end{aligned}$$
(20)

where the subscript w means the index of RES-DG. The corresponding variables of (20) are defined similar to (19).

Consequently, \(ELPV_{DG}\) can be calculated using (19) and (20) as follows:

$$\begin{aligned} & ELPV_{DER} = \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} \left( {\mathop \sum \limits_{h = 1}^{24} \mathop \sum \limits_{j = 1}^{{N_{SG} }} { \hbox{max} }\left\{ {0,\left( {\mathop \sum \limits_{b = 1}^{{N_{b} }} \left( {MCP_{sep,s}^{h} - B_{DG,j,b}^{h} } \right)P_{DG,j,b,s}^{sep,h} - \mathop \sum \limits_{b = 1}^{{N_{b} }} \left( {MCP_{sim,s}^{h} - B_{DG,j,b}^{h} } \right)P_{DG,j,b,s}^{h} } \right)} \right\}} \right) \\ & \quad + \mathop \sum \limits_{s = 1}^{{N_{s} }} \pi_{s} \left( {\mathop \sum \limits_{h = 1}^{24} \mathop \sum \limits_{w = 1}^{{N_{Res} }} { \hbox{max} }\left\{ {0,\left( {\left( {MCP_{sep,s}^{h} - B_{DG,w}^{h} } \right)P_{DG,w,s}^{sep,h} - \left( {MCP_{sim,s}^{h} - B_{DG,w}^{h} } \right)P_{DG,w,s}^{h} } \right)} \right\}} \right) \\ \end{aligned}$$
(21)

where index s in the variables of (21) represents the scenario number.

3.4 Constraints

The objective function (5) is optimized subjected to the following constraints:

  1. 1)

    Power flow equations

    $$P_{G,n,s}^{h} - P_{D,n}^{h} = \left| {V_{n,s}^{h} } \right|\mathop \sum \limits_{m = 1}^{{N_{Bus} }} \left| {V_{m,s}^{h} } \right|\left| {Y_{nm} } \right|{ \cos }\left( {\theta_{n,s}^{h} - \theta_{m,s}^{h} - \varphi_{nm} } \right)$$
    (22)
    $$Q_{G,n,s}^{h} - Q_{D,n}^{h} = \left| {V_{n,s}^{h} } \right|\mathop \sum \limits_{m = 1}^{{N_{Bus} }} \left| {V_{m,s}^{h} } \right|\left| {Y_{nm} } \right|{ \sin }\left( {\theta_{n,s}^{h} - \theta_{m,s}^{h} - \varphi_{nm} } \right)$$
    (23)

    where \(V_{n,s}^{h}\) is the voltage at node n in scenario s and hour h;\(P_{G,n,s}^{h}\) and \(Q_{G,n,s}^{h}\) show active and reactive power generation of node n in scenario s and hour h, respectively; \(P_{D,n}^{h}\) and \(Q_{D,n}^{h}\) are active and reactive power demand of node n and hour h, respectively.

  2. 2)

    The constraints related to the active and reactive power output of DGs and DisCo are expressed as follows:

    $$0 \le P_{DisCo,s}^{h} \le P_{DisCo}^{ \hbox{max} }$$
    (24)
    $$0 \le P_{DG,j,s}^{h} = \mathop \sum \limits_{b = 1}^{{N_{b} }} P_{DG,j,b,s}^{h} \le P_{DG,j}^{ \hbox{max} } \quad j = 1,2, \ldots , N_{SG}$$
    (25)
    $$0 \le P_{DG,w,s}^{h} \le P_{DG,w,s}^{F,h} \quad w = 1,2, \ldots , N_{Res}$$
    (26)
    $$Q_{DisCo}^{ \hbox{min} } \le Q_{DisCo,s}^{h} \le Q_{DisCo}^{ \hbox{max} }$$
    (27)

    where \(P_{DisCo}^{ \hbox{max} }\) and \(P_{DG,j}^{ \hbox{max} }\) signify the maximum active power provided by upstream grid and dispatchable DG j, respectively; \(Q_{DisCo}^{ \hbox{min} }\) and \(Q_{DisCo}^{ \hbox{max} }\) are provided minimum and maximum reactive power by upstream grid, respectively.

    The operation constraints (11)–(17) associated to reactive power of DGs.

  3. 3)

    Bus voltage magnitude

    $$V_{ \hbox{min} } \le \left| {V_{n,s}^{h} } \right| \le V_{ \hbox{max} }$$
    (28)
  4. 4)

    Limit of transformers tap

    $$U_{ \hbox{min} }^{Tap} \le U_{s}^{Tap,h} \le U_{ \hbox{max} }^{Tap}$$
    (29)

    where \(U_{s}^{Tap,h}\), \(U_{ \hbox{min} }^{Tap}\) and \(U_{ \hbox{max} }^{Tap}\) are tap setting of under load tap changing (ULTC) transformer tap position in scenario s and hour h, minimum and maximum of ULTC, respectively.

  5. 5)

    Limit of steps of shunt capacitors

    $$SC_{k}^{ \hbox{min} } \le SC_{k,s}^{h} \le SC_{k}^{ \hbox{max} }$$
    (30)

    where \({SC}_{{k},{s}}^{h}\), \({SC}_{k}^{{\text{min}}}\) and \({SC}_{k}^{\text{max}}\) denote step setting of switched capacitor k in scenario s and hour h, minimum and maximum step of switched capacitor k, respectively.

4 Simulation results

4.1 Case study 1: 22-bus ADN

The proposed market based simultaneous active/reactive power scheduling is examined and analyzed on a modified 22-bus ADN [29]. Two RES-DGs including a WT with capacity 700 kW and a PV with capacity 500 kW as well as a synchronous machine based-DG with rated power 1 MW are connected to the ADN as depicted in Fig. 6. The hourly forecasted active powers of WT and PV have been shown in Fig. 7. Three-step bidding curve of the dispatchable DG has been plotted in Fig. 8. The selling bid prices of WT and PV for energy have been considered 0.032 $/kWh and 0.03 $/kWh for all hours during the next day, respectively. The hourly forecasted prices of the energy in upstream grid, which are offered by DisCo, have been illustrated in Fig. 9. Reactive bids of the DGs and forecasted Q-price of upstream grid have been listed in Table 1. The maximum reactive power provision by upstream grid is 2.1 Mvar.

Fig. 6
figure 6

Modified 22-bus ADN

Fig. 7
figure 7

Hourly forecasted power of WT and PV

Fig. 8
figure 8

Three-step bidding curve of the dispatchable DG for case study 1

Fig. 9
figure 9

Hourly forecasted energy prices in upstream grid

Table 1 Reactive bids of DGs and upstream grid for case study 1

The proposed probabilistic simultaneous active/reactive scheduling problem is solved by the DICOPT solver in the GAMS environment. The expected scheduled active and reactive power related to DGs and DisCo are, respectively, depicted in Figs. 10 and 11.

Fig. 10
figure 10

Expected scheduled active power of DGs and DisCo for case study 1

Fig. 11
figure 11

Expected scheduled reactive power of DGs and DisCo for case study 1

The optimization results of the presented stochastic simultaneous scheduling are reported in Table 2 Moreover, Table 3 details different portions of the objective function corresponding to DisCo and DGs. Here, based on the proposed formulation of the LPV for DGs, the expected value of LPV of dispatchable DG unit is lower comparing to the WT and PV units. Therefore, in order to provide the reactive power required by the system, the reduction of the active power of the dispatchable DG will be profitable to the DSO due to its higher bid prices for energy. Accordingly, the LPV cost is only paid to the dispatchable DG unit. The expected total active power losses of the system for the next day will be 1637.1 kW, which is approximately equal to the expected losses of the network obtained by the separate scheduling method [22], i.e., 1637.34 kW.

Table 2 Optimization results of the stochastic simultaneous scheduling for case study 1
Table 3 Different components of P-Q stochastic simultaneous scheduling cost

For a more detailed investigation, the results of the proposed P-Q stochastic simultaneous scheduling method has been compared with the stochastic separate active and reactive power scheduling approach presented in [22]. Table 4 details the different components of cost objective functions corresponding to stochastic simultaneous and separate scheduling methods. According to the achieved results, the expected value of cost objective function in the simultaneous scheduling method has been $ 5005.72 that is lower than the total expected cost of separate energy and reactive power scheduling, i.e. $ 5065.16. The most important part of this difference is pertaining to the mechanism of the LOC and LPV payment in both methods. Whereas, if the total energy and reactive power costs by ignoring LOC (in separate scheduling method) and LPV (in simultaneous scheduling method) are computed for both approaches, the difference between them will diminish. The stochastic programming results denote that the P-Q stochastic simultaneous scheduling method attains better scheduling results from economical viewpoint compared to the separate scheduling approach. If the uncertainties of upstream grid prices and output power generation of renewable units are disregarded (deterministic framework) the objective function of simultaneous scheduling method will become $ 4977.26. Accordingly, considering the uncertainties prices and output power of renewable generations by DSO will lead to a higher operation scheduling cost of distribution system.

Table 4 Settlement results of the simultaneous and separate scheduling methods in stochastic framework for case study 1

4.2 Case study 2: IEEE 33-bus ADN

To validate the proposed market based simultaneous active/reactive power scheduling, the IEEE 33-bus distribution system is employed as the second case study. Three RES-DGs including a WT and two PV units as well as three dispatchable DGs are connected to the ADN as illustrated in Fig. 12. The rated power of DGs has been shown in the Fig. 12. A 50% increase in all loads of the IEEE 33-bus ADN has been assumed. For simplicity, the hourly forecasted active powers of WT and PVs along with the hourly forecasted prices of the energy in upstream grid have been considered as the same ones in case study 1. The bidding curves of the DGs have been plotted in Fig. 13. The energy costs of WT and PVs have been considered as 0.031 $/kWh and 0.028 $/kWh for all hours, respectively. Reactive bids of the DGs and predicted Q-price of upstream grid have been reported in Table 5. The maximum reactive power provision by upstream grid is 2 Mvar.

Fig. 12
figure 12

IEEE 33-bus ADN

Fig. 13
figure 13

Bidding curves of the dispatchable DGs for case study 2

Table 5 Reactive bids of the DGs and upstream grid for case study 2

In the optimization procedure, each considered scenario contains different values for output powers of WT and PVs and the prices of upstream grid.. Despite the deterministic method, implementing the proposed stochastic simultaneous active/reactive power scheduling, all considered scenarios contribute into determining the active and reactive power levels of different units according to their probability values. The expected active and reactive power levels of generation units are, respectively, illustrated in Figs. 14 and 15.

Fig. 14
figure 14

Expected active power levels of DGs and DisCo for case study 2

Fig. 15
figure 15

Expected reactive power levels of DGs and DisCo for case study 2

The optimization results of the presented model have been listed in Table 6. The total expected energy and reactive power costs as well as the expected LPV in the stochastic P-Q scheduling framework are greater than the corresponding one in deterministic scheduling scheme, i.e. $5137.42. This indicates that ADN uncertainties leads the costs of stochastic scheduling model to be more expensive than the deterministic model. This extra cost can be reflected as the cost of the uncertainties of ADN in the simultaneous active/reactive power scheduling.

Table 6 Optimization results of the stochastic simultaneous scheduling for case study 2

5 Conclusion

This paper presents an efficient stochastic programming for optimal active and reactive power scheduling to find the robust scheduling of DGs and the scheduled input power from the upstream grid. The proposed stochastic simultaneous active/reactive power scheduling consists of two stages. In the first stage, based on the RWM and LMCS approaches, some randomly scenarios corresponding to the intermittent renewable power generation and upstream grid prices are created and then properly reduced. In the second stage, the simultaneous active and reactive power scheduling methodology is utilized for the opted scenarios. In the proposed model, DisCos act as intermediate entities between wholesale market and distribution system. A DisCo purchases energy and reactive power from upstream market and sells them to the DSO via proposed distribution market. Instead of the LOC payment for DGs, a new payment index as LPV was introduced to compensate for possible financial detriment arising from reduction in energy sales profit in simultaneous dispatch compared to the separate active power dispatch. The proposed approach is investigated on the modified 22-bus and IEEE 33-bus ADNs to demonstrate its applicability. The stochastic programming results denote that the P-Q stochastic simultaneous scheduling method attains better dispatch scheduling results from economical viewpoint compared to the separate scheduling approach. Considering the uncertainty prices and output power of renewable generations by DSO will lead to a higher operation scheduling cost of distribution system. The obtained results of proposed stochastic framework will be reliable for DSO. Furthermore, the exploitation of the stochastic approach can enhance the reliability of the optimal solution with capturing more uncertainty range.