1 Introduction

Conventionally, the distribution networks were not active networks where the flow of both real and reactive power is always from main grid to distribution network. However, with significant penetration of distributed generation, the power flows may become reversed. The distribution network with DG can be considered as a microgrid; hence, there are dramatic changes in the nature of distribution networks with distributed generation. Distributed generation has attracted the interest of many researches (Georgilakis and Hatziargyriou 2013). Unlike transmission systems, typical line reactance-to-resistance ratios in distribution networks are such that bus voltages are much more sensitive to changes in active power injections (Zhao et al. 2017; Keane et al. 2011). An architecture for voltage regulation in distribution networks that relies on controlling reactive power injections provided by distributed energy resources (DERs) is presented in Robbins et al. (2013). Voltage violations are traditionally controlled by automatically controlled tap-changing under load (TCUL) transformers, set voltage regulators and static var compensator in distribution network (SVC), and manually controlled fixed/switched capacitors (Tarafdar Haque and Hosseini 2002; Wong et al. 2017; Zhang et al. 2016). However, existing equipment is not intrinsically designed to handle the variability announced by DERs, and the lifetime of these components (e.g., the switches and tap changers) could be intensely short due to the increased number of operations that they may undergo (Tarafdar Haque and Hosseini 2002). A potential solution for this problem lies on the utilization of DERs to provide reactive power support for voltage regulation through correct control of power electronics that interface them with the grid (Banshwar et al. 2017; Domínguez-García et al. 2011; Niknam et al. 2005). Control of reactive power generation by photovoltaic inverters in a power distribution circuit expresses in Sulc et al. (2014) as a constrained optimization that purposes to minimize power losses subject to finite inverter capacity and upper and lower voltage limits at all nodes in the circuit. In Zheng et al. (2017), a dual time-scale coordination for Volt–VAr control scheme, corresponding to slow and fast control, is proposed. Slow control guarantees that following fast controls can preserve system’s voltage security if uncertain parameters are different within predefined limits. A column-and-constraint generation algorithm is used to solve the robust convexities model. A conventional deterministic optimization model can be used to determine fast control mechanism. In Kulmala et al. (2014), two coordinated voltage control algorithms suitable for usage in distribution networks including several distributed energy resources are proposed to delete voltage rise problems.

In Molina-García et al. (2017), a reactive power flow control pursuing the active integration of photovoltaic systems in distribution networks is proposed. The proposed method gives high performances, in terms of rms voltage regulation, by estimating reactive power reference on each node considering the influence of rest of nodes in terms of active and reactive power demanded/generated by them. In Wang et al. (2015), distributed energy storage systems to solve the voltage rise/drop issues in low-voltage (LV) distribution networks with a high penetration of rooftop photovoltaics (PVs) are proposed. A coordinated control method, which includes distributed and localized controls, is proposed for distributed ESSs. The distributed control using the harmony algorithm regulates feeder voltages within prerequisite limits, while the localized control adjusts the state of charge (SoC) of each ESS within the anticipated SoC range. The entire control structure ensures voltage regulation while effectively utilizing storage capacity under various operation situations. There are two main methods in order to control these power electronic interfaces: (1) local control; (2) coordinated control (Zhang et al. 2015; Hu et al. 2016). Even if the methods based on local control have high response time, because of using local data, they are not optimum. Furthermore, lack of enough acquaintance about other parts of the network may lead to decision mistakes (Ranamuka et al. 2016; Guo et al. 2015). To improve performance of these methods, a secondary management level is employed which uses bidirectional communication infrastructure between secondary control center (CC) and all reactive power controllers and coordinates the contribution proportion of these sources in voltage management problem in an optimum way. Most of the previous coordination methods are based on centralized architecture in which one center is responsible for supervising network’s operation (Cagnano and Tuglie 2015; Paaso et al. 2014). According to unbalanced nature of the distribution networks as well as increased number of generators and consequently control variables in a smart grid, the time required for computational operations and the amount of information which need to be processed will greatly increase so majority of these methods cannot be implemented as online. Therefore, it is necessary to pursue other methods such as decentralized ones.

Voltage variations in distribution networks depend on active and reactive power of transmission lines. Therefore, voltage is maintained in an allowable range by controlling active and reactive power. In the proposed approach, generation microcontroller and measurement (GMCM) and load microcontroller and measurement (LMCM) are located on any bus in the distribution network that has DGs and loads. DGs are generally divided into two categories such as dispatchable and non-dispatchable units. Dispatchable units are capable of controlling active and reactive power to meet their purpose, but non-dispatchable units are only able to control reactive power and their active power is determined according to a predefined power curve. GMCM and LMCM units are internal controllers to regulate the generation of DG and consumption of load based on a set point. Also these units measure voltage, transmitted active and reactive power and necessary parameters of all buses. Non-dispatchable units such as photovoltaic and wind turbines generate their power according to the shape of the power curve which gives maximum power point tracking (MPPT) in the specification area. Loads consume their power depending on daily peak load. For each bus, ARMU defines the set points of dispatchable units to meet the objectives of each bus. In ARMUs, set points are obtained by distributed optimization process. Distribution subgradient method is used in the optimization system. At optimization method, variation occurs in half an hour in period of time (seconds, minutes, hours) and is repeated K times in each variation. The proposed framework will be of great interest to DGs operators and management units. GMCMs and LMCMs can use this framework to control optimal set points of active and reactive power of DGs and loads. Because of the use of a generalized approach to modeling active and reactive power management, ARMUs can use the framework to formulate the proposed management system that induces GMCMs and LMCMs to meet predefined goals. To obtain the proposed framework, models of individual active and reactive power management units based on distribution subgradient optimization are derived.

The first novel proposed method in comparison with other methods has no need to control center. It means that it distributes problem execution into various independent ARMUs. The proposed method offers the following advantage. (1) Although center control breaks down, proposed power management is done correctly. (2) It proposes a new controller in the secondary control level of distribution network based on minimization of loss, buses’ voltage variation, load shedding and variation of power generation. (3) Distributed computing time in ARMU is less than others.(4) Under some condition, ARMU with only uses RPC is not able to control network; therefore, ARMU should use other control actions like APC of dispatchable DGs and loads.

The remaining of this paper is structured as follows: In Sect. 2, voltage sensitivity matrices of distribution network are presented. In Sects. 3 and 4, an overview of active power control management and reactive power control management individually using distribution method is presented. This is followed by the mathematical modeling of the associated optimization models in Sects. 3 and 4. In Sect. 5, proposed ARMU is presented. Finally, in Sect. 6, the results of implementing the proposed model in a 33-bus distribution network under multiple situations are shown.

2 Voltage Sensitivity Matrix of the Distribution Network

For mathematical modeling of power management and dynamic voltage control technique simultaneously, the sensitivity matrix of active and reactive power is calculated (Nayeripour et al. 2016). Considering the single-line diagram of a balanced three-phase network in Fig. 1, bus voltages vector in the distribution network based on active and reactive power is obtained by Eq. (1):

$$[\Delta V] = [S^{\text{vp}} ][\Delta p] + [S^{\text{vq}} ][\Delta q].$$
(1)
Fig. 1
figure 1

Single bus of 13 distribution networks

Based on the method presented in Fallahzadeh-Abarghouei et al. (2017), BIBC and BCBV are obtained from Eqs. (2) and (3).

$$\begin{aligned} [B] & = \left[ {\begin{array}{*{20}c} {B_{1} } \\ {B_{2} } \\ {B_{3} } \\ {B_{4} } \\ {B_{5} } \\ {B_{6} } \\ {B_{7} } \\ {B_{8} } \\ {B_{9} } \\ {B_{10} } \\ {B_{11} } \\ {B_{12} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} {I_{1} } \\ {I_{2} } \\ {I_{3} } \\ {I_{4} } \\ {I_{5} } \\ {I_{6} } \\ {I_{7} } \\ {I_{8} } \\ {I_{9} } \\ {I_{10} } \\ {I_{11} } \\ {I_{12} } \\ \end{array} } \right] \\ & = [{\text{BIBC}}][I], \\ \end{aligned}$$
(2)
$$\begin{aligned} \left[ {\begin{array}{*{20}c} {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ \end{array} } \right] - \left[ {\begin{array}{*{20}c} {V_{2} } \\ {V_{3} } \\ {V_{4} } \\ {V_{5} } \\ {V_{6} } \\ {V_{7} } \\ {V_{8} } \\ {V_{9} } \\ {V_{10} } \\ {V_{11} } \\ {V_{12} } \\ {V_{13} } \\ \end{array} } \right] & = \left[ {\begin{array}{*{20}c} {Z_{1} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & {Z_{2} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & {Z_{2} } & {Z_{3} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & {Z_{4} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & {Z_{4} } & {Z_{5} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & 0 & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & {Z_{7} } & 0 & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & {Z_{7} } & {Z_{8} } & 0 & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & 0 & 0 & {Z_{9} } & 0 & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & 0 & 0 & 0 & {Z_{10} } & 0 & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & 0 & 0 & 0 & {Z_{10} } & {Z_{11} } & 0 \\ {Z_{1} } & 0 & 0 & 0 & 0 & {Z_{6} } & 0 & 0 & 0 & {Z_{10} } & 0 & {Z_{12} } \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} {B_{1} } \\ {B_{2} } \\ {B_{3} } \\ {B_{4} } \\ {B_{5} } \\ {B_{6} } \\ {B_{7} } \\ {B_{8} } \\ {B_{9} } \\ {B_{10} } \\ {B_{11} } \\ {B_{12} } \\ \end{array} } \right] \\ & = [{\text{BCBV}}][B]. \\ \end{aligned}$$
(3)

According to matrices in Eqs. (2) and (3) using direct load flow (DLF), bus currents are linked to bus voltages by Eq. (4).

$$[V_{0} ] - [V] \, = \, [{\text{BCBV}}] \, [{\text{BIBC}}] \, [I] = [{\text{DLF}}] \, [I].$$
(4)

Finally, bus voltage variations are obtained according to variations of active and reactive power in each bus based on Eq. (5).

$$\begin{aligned} \left[ {\begin{array}{*{20}c} {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ {V_{1} } \\ \end{array} } \right] - \left[ {\begin{array}{*{20}c} {V_{2} } \\ {V_{3} } \\ {V_{4} } \\ {V_{5} } \\ {V_{6} } \\ {V_{7} } \\ {V_{8} } \\ {V_{9} } \\ {V_{10} } \\ {V_{11} } \\ {V_{12} } \\ {V_{13} } \\ \end{array} } \right] & = \left[ {\begin{array}{*{20}c} {r_{1} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & {r_{2} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & {r_{2} } & {r_{3} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & {r_{4} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & {r_{4} } & {r_{5} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & 0 & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & {r_{7} } & 0 & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & {r_{7} } & {r_{8} } & 0 & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & 0 & 0 & {r_{9} } & 0 & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & 0 & 0 & 0 & {r_{10} } & 0 & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & 0 & 0 & 0 & {r_{10} } & {r_{11} } & 0 \\ {r_{1} } & 0 & 0 & 0 & 0 & {r_{6} } & 0 & 0 & 0 & {r_{10} } & 0 & {r_{12} } \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} {p_{1} } \\ {p_{2} } \\ {p_{3} } \\ {p_{4} } \\ {p_{5} } \\ {p_{6} } \\ {p_{7} } \\ {p_{8} } \\ {p_{9} } \\ {p_{10} } \\ {p_{11} } \\ {p_{12} } \\ \end{array} } \right] \\ & \quad + \left[ {\begin{array}{*{20}c} {x_{1} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & {x_{2} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & {x_{2} } & {x_{3} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & {x_{4} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & {x_{4} } & {x_{5} } & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & 0 & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & {x_{7} } & 0 & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & {x_{7} } & {x_{8} } & 0 & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & 0 & 0 & {x_{9} } & 0 & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & 0 & 0 & 0 & {x_{10} } & 0 & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & 0 & 0 & 0 & {x_{10} } & {x_{11} } & 0 \\ {x_{1} } & 0 & 0 & 0 & 0 & {x_{6} } & 0 & 0 & 0 & {x_{10} } & 0 & {x_{12} } \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{array} } \right]\;\left[ {\begin{array}{*{20}c} {q_{1} } \\ {q_{2} } \\ {q_{3} } \\ {q_{4} } \\ {q_{5} } \\ {q_{6} } \\ {q_{7} } \\ {q_{8} } \\ {q_{9} } \\ {q_{10} } \\ {q_{11} } \\ {q_{12} } \\ \end{array} } \right] \\ & = - [S^{\text{vp}} ][p] - [S^{\text{vq}} ] \cdot [q]. \\ \end{aligned}$$
(5)

3 Active Power Management System Modeling

Assume that DGs have been already installed and then GMCMs and LMCMs regulate optimum control commands to DGs and loads in order to minimize variation of voltage and power losses. To minimize the active power losses, the objective function is defined as follows:

$$f_{\text{L}} = \sum\limits_{l = 1}^{N} {f_{{{\text{L}},l}} } = \sum\limits_{l = 1}^{N} {\sum\limits_{x = a,b,c} {\frac{{\left( {P_{l}^{x} } \right)^{2} + \left( {Q_{l}^{x} } \right)^{2} }}{{\left( {V_{l}^{x} } \right)^{2} }}} \cdot \sum\limits_{y = a,b,c} {r_{l}^{xy} } } .$$
(6)

To keep the voltage profile within the desired range, the secondary objective function of voltage violation is defined as follows:

$$f_{\text{V}} = \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{OVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{max} } } \right)^{2} } } + \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{UVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{min} } } \right)^{2} } } ,$$
(7)

where \({\text{OVF}}_{K}^{x}\) and \({\text{UVF}}_{K}^{x}\) indicate overvoltage and under voltage of phase x, respectively, at K bus defined as follows:

$${\text{OVF}}_{k}^{x} = \left\{ {\begin{array}{*{20}c} 1 & {V_{k}^{x} > V_{k}^{\hbox{max} } } \\ 0 & {V_{k}^{x} \le V_{k}^{\hbox{max} } } \\ \end{array} } \right.,\quad {\text{UVF}}_{k}^{x} = \left\{ {\begin{array}{*{20}c} 1 & {V_{k}^{x} < V_{k}^{\hbox{min} } } \\ 0 & {V_{k}^{x} \ge V_{k}^{\hbox{min} } } \\ \end{array} } \right..$$
(8)

To achieve the mentioned goal, it is necessary to curtail minimum generation power and shed load power as much as possible.

$$f_{\text{C}} = \sum\limits_{i = 1}^{{n{\text{G}}}} {\sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{G}},{\text{cur}}}} } \right)^{2} } } = \sum\limits_{i = 1}^{{n{\text{G}}}} {\sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{G}},\hbox{max} }} - p_{i}^{{x,{\text{G}}}} } \right)^{2} } } ,$$
(9)
$$f_{\text{S}} = \sum\limits_{i = 1}^{{n{\text{L}}}} {\sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{L}},{\text{shed}}}} } \right)^{2} } } = \sum\limits_{i = 1}^{{n{\text{L}}}} {\sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{L}},\hbox{max} }} - p_{i}^{{x,{\text{L}}}} } \right)^{2} } } .$$
(10)

Ultimately, the objective function is defined as the sum of weighted functions expressed as follows:

$$f = w_{\text{L}} \cdot f_{\text{L}} + w_{\text{V}} \cdot f_{\text{V}} + w_{\text{C}} \cdot f_{\text{C}} + w_{\text{S}} \cdot f_{\text{S}} ,$$
(11)

where \(w_{\text{L}}\), \(w_{\text{V}}\), \(w_{\text{C}}\) and \(w_{\text{S}}\) are constant weighted coefficients. Reference active power of DGs and loads is control variables as follows:

$$u = [p_{n1}^{\text{L}} ,p_{n2}^{\text{L}} , \ldots ,p_{{n{\text{L}}}}^{\text{L}} ,\quad p_{n1}^{\text{G}} ,p_{n2}^{\text{G}} , \ldots ,p_{{n{\text{G}}}}^{\text{G}} ]^{\text{T}} .$$
(12)

Curtailment of generation power is continuous. Load shedding commands are discretely done by LMCM. Therefore, curtailment and shedding power should be in the following ranges:

$$\left\{ {\begin{array}{*{20}c} {0 \le p_{i}^{\text{L}} \le p_{i}^{L,\hbox{max} } } & {i = n1, \ldots ,n{\text{L}}} \\ {0 \le q_{i}^{\text{L}} \le q_{i}^{L,\hbox{max} } } & {i = n1, \ldots ,n{\text{L}}} \\ {0 \le p_{i}^{\text{G}} \le p_{i}^{G,\hbox{max} } } & {i = n1, \ldots ,n{\text{G}}} \\ \end{array} } \right..$$
(13)

According to these relationships, objective functions have a square form and their constraints are linear. Therefore, this problem is a convex constrained optimization one. To solve this optimization problem, distribution subgradient method is used. The advantage is that distributed computing time is less than the centralized approach in ARMUs. The proposed optimization method can be run online for large-scale problems. In analytical distributed approaches, there is no special center, i.e., centralized agent to coordinate the performance of local agents. Each local GMCM and LMCM collects required information and takes control actions for its corresponded control variables in the direction of global objective functions individually. Indeed, distributed method is designed to be able to operate properly in the presence of limited or unreliable communications links or often in the absence of a central control mechanism.

3.1 The Proposed Optimization Method

Suppose that \(f(u):R^{n} \to R\) is optimization objective function. Subgradient method is repeated according to the following equation:

$$u(t + 1) = u(t) - \alpha_{t} \cdot \nabla f(u(t)),$$
(14)

where \(\nabla f(u(t))\) is gradient function of f with respect to u(t). Unlike gradient method in which step length toward the optimum point is variable and should be updated in each iteration, this parameter is constant in subgradient method. So step length toward the optimal point is not in the direction of maximum slope, and the algorithm will converge after more iterations. Under these assumptions, control variables can be updated separately in the subgradient method. The distributed form of Eq. (14) is as follows:

$$u_{i} (t + 1) = u_{i} (t) - \alpha_{t} \cdot \nabla f_{i} (u(t)).$$
(15)

In Eq. (15), \(u_{i} (t)\) is ith element of \(u(t)\) vector. More information about optimality, speed of convergence and error analysis is provided in Cheng et al. (2005). Numerical approximation of \(\nabla f_{i} (u(t))\) is as follows:

$$\nabla f_{i} (u(t)) = \frac{{f_{i} (u(t)) - f_{i} (u(t - 1))}}{{u_{i} (t) - u_{i} (t - 1)}}.$$
(16)

To calculate \(\nabla f_{i} (u(t))\) based on Eq. (16), it is necessary to have \(f_{i} (u(t))\) and \(f_{i} (u(t - 1))\). Determining the updating time interval between \(u(t)\) and \(u(t - 1)\) is a main concern. A short duration of time may not be sufficient for the convergence of algorithm, and a long duration may lead to low accuracy in calculations because of random nature of renewable resources under severe and rapid operating conditions. Therefore, \(\nabla f_{i} (u(t))\) should be calculated based on the current state of the distribution network.

3.2 Mathematical Calculation of Distributed Derivative

To simplify the implementation of the proposed method, in the active power losses objective function, line voltage is approximated with its nominal value. Therefore, the voltage of all lines and phases is assumed to be 1 Pu. Equation (6) can be rewritten as follows:

$$f_{\text{L}} = \sum\limits_{l = 1}^{N} {\sum\limits_{x = a,b,c} {\left[ {\left( {P_{l}^{x} } \right)^{2} + \left( {Q_{l}^{x} } \right)^{2} } \right]} \cdot \sum\limits_{y = a,b,c} {r_{l}^{xy} } } .$$
(17)

Gradient vector control variables are shown as follows:

$$\nabla f(u) = \left[ {\frac{\partial f}{{\partial p_{n1}^{\text{L}} }},\frac{\partial f}{{\partial p_{n2}^{\text{L}} }}, \ldots ,\frac{\partial f}{{\partial p_{{n{\text{L}}}}^{\text{L}} }}\quad \frac{\partial f}{{\partial p_{n1}^{\text{G}} }},\frac{\partial f}{{\partial p_{n2}^{\text{G}} }}, \ldots ,\frac{\partial f}{{\partial p_{{n{\text{G}}}}^{\text{G}} }}} \right]^{\text{T}} .$$
(18)

As evidenced in Eq. (18), two categories of differentiation are defined. The first category is derivative of objective function with respect to generators active power and second one is the derivative of objective function with respect to consumed active power. Relationships to extract these two derivative terms will be detailed in the following section.

3.2.1 Calculation of \({{\partial f} / {\partial p_{i}^{{\text{G}}} }}\) for Generators

Due to constant weight coefficients of objective functions, derivative of objective function with respect to reactive power can be written as:

$$\frac{\partial f}{{\partial p_{i}^{\text{G}} }} = w_{\text{L}} \cdot \frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{\text{G}} }} + w_{\text{V}} \cdot \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{\text{G}} }} + w_{\text{C}} \cdot \frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{\text{G}} }} + w_{\text{S}} \cdot \frac{{\partial f_{\text{S}} }}{{\partial p_{i}^{\text{G}} }}.$$
(19)

To express \(f_{\text{L}}\) and \(f_{\text{V}}\) in terms of \(p_{i}^{\text{G}}\), \(p_{k}^{x}\) and \(q_{k}^{x}\) can be expressed as follows:

$$\begin{aligned} & p_{k}^{x} = \left( {p_{i}^{{x,{\text{L}},\hbox{max} }} - p_{i}^{{x,{\text{L}},{\text{shed}}}} } \right) - \left( {p_{i}^{{x,{\text{G}},\hbox{max} }} - p_{i}^{{x,{\text{G}},{\text{cur}}}} } \right), \\ & q_{k}^{x} = \left( {q_{i}^{{x,{\text{L}},\hbox{max} }} - q_{i}^{{x,{\text{L}},{\text{shed}}}} } \right). \\ \end{aligned}$$
(20)

Since it is assumed that all generators are operating in active power control (APC) mode, all network buses can be considered as PQ bus. Thus, active power losses can be rewritten using BIBC matrix as follows:

$$f_{\text{L}} = \sum\limits_{l = 1}^{N} {\sum\limits_{x = a,b,c} {\sum\limits_{y = a,b,c} {r_{l}^{xy} } \cdot } } \left[ {\left( {\sum\limits_{k = 1}^{N} {{\text{bibc}}_{lk} \cdot \left( {\left( {p_{i}^{{x,{\text{L}},\hbox{max} }} - p_{i}^{{x,{\text{L}},{\text{shed}}}} } \right) - \left( {p_{i}^{{x,{\text{G}},\hbox{max} }} - p_{i}^{{x,{\text{G}},{\text{cur}}}} } \right)} \right)} } \right)^{2} + \left( {\sum\limits_{k = 1}^{N} {{\text{bibc}}_{lk} \cdot \left( {q_{i}^{{x,{\text{L}},\hbox{max} }} - q_{i}^{{x,{\text{L}},{\text{shed}}}} } \right)} } \right)^{2} } \right].$$
(21)

As shown in Eq. (22), active power generations in three phases are the same.

$$p_{i}^{\text{G}} = p_{i}^{{a,{\text{G}}}} = p_{i}^{{b,{\text{G}}}} = p_{i}^{{c,{\text{G}}}} .$$
(22)

Derivative of \(f_{\text{L}}\) in terms of \(p_{i}^{\text{G}}\) is as follows:

$$\begin{aligned} \frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{\text{G}} }} & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{x = a,b,c} {\sum\limits_{y = a,b,c} {r_{l}^{xy} \cdot {\text{bibc}}_{li} \cdot \sum\limits_{k = 1}^{N} {{\text{bibc}}_{lk} \cdot \left( {\left( {p_{i}^{{x,{\text{L}},\hbox{max} }} - p_{i}^{{x,{\text{L}},{\text{shed}}}} } \right) - \left( {p_{i}^{{x,{\text{G}},\hbox{max} }} - p_{i}^{{x,{\text{G}},{\text{cur}}}} } \right)} \right)} } } } , \\ & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{x = a,b,c} {\sum\limits_{y = a,b,c} {r_{l}^{xy} \cdot {\text{bibc}}_{li} \cdot P_{l}^{x} } .} } \\ \end{aligned}$$
(23)

Suppose DG is a single-phase generator installed at phase z in ith bus; Eq. (23) in each phase is calculated as follows:

$$\begin{aligned} \frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{{z,{\text{G}}}} }} & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{y = a,b,c} {r_{l}^{zy} } \cdot {\text{bibc}}_{li} \cdot \sum\limits_{k = 1}^{N} {{\text{bibc}}_{lk} \cdot \left( {\left( {p_{i}^{{z,{\text{L}},\hbox{max} }} - p_{i}^{{z,{\text{L}},{\text{shed}}}} } \right) - \left( {p_{i}^{{z,{\text{G}},\hbox{max} }} - p_{i}^{{z,{\text{G}},{\text{cur}}}} } \right)} \right)} } , \\ & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{y = a,b,c} {r_{l}^{zy} } \cdot {\text{bibc}}_{li} \cdot P_{l}^{z} } . \\ \end{aligned}$$
(24)

The second term in derivative of objective function with respect to active power generator is as follows:

$$\begin{aligned} \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{\text{G}} }} & = 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{OVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{max} } } \right) \cdot } } \frac{{\partial V_{k}^{x} }}{{\partial p_{i}^{\text{G}} }}, \\ & \quad + 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{UVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{min} } } \right) \cdot } } \frac{{\partial V_{k}^{x} }}{{\partial p_{i}^{\text{G}} }}. \\ \end{aligned}$$
(25)

Based on Eq. (25) for three phases of generators, Eq. (26) will be proved.

$$\frac{{\partial V_{k}^{x} }}{{\partial p_{i}^{\text{G}} }} = \sum\limits_{y = a,b,c} {R_{ki}^{xy} } \quad x = a,b,c$$
(26)

The second terms of the relationship (19) using Eqs. (25) and (26) can be calculated as follows:

$$\begin{aligned} \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{\text{G}} }} & = 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{OVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{max} } } \right) \cdot } } \sum\limits_{y = a,b,c} {R_{ki}^{xy} } , \\ & \quad + 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{UVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{min} } } \right) \cdot } } \sum\limits_{y = a,b,c} {R_{ki}^{xy} } . \\ \end{aligned}$$
(27)

Suppose DG is a single-phase generator installed at phase z in ith bus; then recent relationship in each phase is calculated as follows:

$$\begin{aligned} \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{{z,{\text{G}}}} }} & = 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{OVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{max} } } \right) \cdot } } R_{ki}^{xz} , \\ & \quad + 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{UVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{min} } } \right) \cdot } } R_{ki}^{xz} . \\ \end{aligned}$$
(28)

The third term in the derivative of objective function with respect to generator active power is as follows:

$$\frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{\text{G}} }} = - 2 \cdot \sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{G}},\hbox{max} }} - p_{i}^{{x,{\text{G}}}} } \right)} .$$
(29)

Suppose DG is a single-phase generator installed at phase z in ith bus; then (29) in each phase is calculated as follows:

$$\frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{{z,{\text{G}}}} }} = - 2 \cdot \left( {p_{i}^{{z,{\text{G}},\hbox{max} }} - p_{i}^{{z,{\text{G}}}} } \right).$$
(30)

As active power load shedding is independent of active power generation, finally for single- and three-phase DGs, (31) is obtained.

$$\frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{\text{G}} }} = 0,\quad \frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{{z,{\text{G}}}} }} = 0.$$
(31)

3.2.2 \({{\partial f} / {\partial p_{i}^{{\text{L}} }}}\) Calculation of Loads

In each bus, loads and DGs output power are asymmetrical to each other. So with same reasoning as above, the first and second terms in derivatives of objective functions to load power are calculated. Derivative of \(f_{\text{L}}\) in terms of \(p_{i}^{\text{L}}\) for three-phase loads is as follows:

$$\frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{\text{L}} }} = - \frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{\text{G}} }}.$$
(32)

Equation (24) is calculated for unbalanced three-phase z load as follows:

$$\frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{{z,{\text{L}}}} }} = - \frac{{\partial f_{\text{L}} }}{{\partial p_{i}^{{z,{\text{G}}}} }}.$$
(33)

The second term derivative objective function to active power of balanced three-phase load is as follows:

$$\frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{\text{L}} }} = - \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{\text{G}} }}.$$
(34)

The relationship of (28) for unbalanced three-phase load is as follows:

$$\frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{{z,{\text{L}}}} }} = - \frac{{\partial f_{\text{V}} }}{{\partial p_{i}^{{z,{\text{G}}}} }}.$$
(35)

Since the curtailment power generation is independent of active power load, for both balanced and unbalanced three-phase load:

$$\frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{\text{L}} }} = 0,\quad \frac{{\partial f_{\text{C}} }}{{\partial p_{i}^{{z,{\text{L}}}} }} = 0.$$
(36)

Finally, the fourth term derivative load shedding objective function to balanced three-phase active power is calculated as follows:

$$\frac{{\partial f_{\text{S}} }}{{\partial p_{i}^{\text{L}} }} = - 2 \cdot \sum\limits_{x = a,b,c} {\left( {p_{i}^{{x,{\text{L}},\hbox{max} }} - p_{i}^{{x,{\text{L}}}} } \right)} .$$
(37)

Equation (31) for phase z of the unbalanced three-phase load at ith bus is calculated as follows:

$$\frac{{\partial f_{\text{S}} }}{{\partial p_{i}^{{z,{\text{L}}}} }} = - 2 \cdot \left( {p_{i}^{{z,{\text{L}},\hbox{max} }} - p_{i}^{{z,{\text{L}}}} } \right).$$
(38)

After updating all of the control variables by embedded distributed derivative in Eq. (15), if any updated variables are out of range, it should be limited to upper and lower bounds based on Eq. (13). This algorithm is implemented for active power control (APC).

4 Reactive Power Management System Modeling

Similar to active power management modeling, the objective function is defined as the sum of weighted functions expressed as follows:

$$f = w_{\text{L}} \cdot f_{\text{L}} + w_{\text{V}} \cdot f_{\text{V}} ,$$
(39)

where \(w_{\text{L}}\) and \(w_{\text{V}}\) are constant weighted coefficients. Control variables are reference reactive power of DGs as follows:

$$u = \left[ {q_{n1}^{\text{G}} ,q_{n2}^{\text{G}} , \ldots ,q_{{n{\text{G}}}}^{\text{G}} } \right]^{\text{T}} .$$
(40)

The control variables must be in the following ranges:

$$q_{i}^{{{\text{G}},\hbox{min} }} \le q_{i}^{\text{G}} \le q_{i}^{{{\text{G}},\hbox{max} }} \quad i = n1, \ldots ,n{\text{G}} .$$
(41)

Similar to pervious method, objective functions have square form and their constraint is linear; so the problem is a constrained and convex optimization one.

4.1 Calculation \({\mathbf{\partial }}\varvec{f}/{\mathbf{\partial }}\varvec{q}_{\varvec{i}}^{{\mathbf{G}}}\) for Generators

Due to constant weighted coefficients of objective functions, derivative objective function to reactive power can be written as:

$$\frac{\partial f}{{\partial q_{i}^{\text{G}} }} = w_{\text{L}} \cdot \frac{{\partial f_{\text{L}} }}{{\partial q_{i}^{\text{G}} }} + w_{\text{V}} \cdot \frac{{\partial f_{\text{V}} }}{{\partial q_{i}^{\text{G}} }}.$$
(42)

To express \(f_{\text{L}}\) and \(f_{\text{V}}\) in terms of \(q_{i}^{\text{G}}\), \(p_{k}^{x}\) and \(q_{k}^{x}\) can be expressed as follows:

$$p_{k}^{x} = p_{k}^{{x,{\text{L}}}} - p_{k}^{{x,{\text{G}}}} ,\quad q_{k}^{x} = q_{k}^{{x,{\text{L}}}} - q_{k}^{{x,{\text{G}}}} .$$
(43)

Suppose DG is a single-phase generator installed at phase z in ith bus; after proving process of obtaining derivatives distributed in accordance with the previous method, two distributed objective functions of derivatives losses and voltage profile to reactive power are obtained from (44) and (45). This algorithm is implemented for reactive power control (RPC).

$$\begin{aligned} \frac{{\partial f_{\text{L}} }}{{\partial q_{i}^{{z,{\text{G}}}} }} & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{y = a,b,c} {r_{l}^{zy} } \cdot {\text{bibc}}_{li} \cdot \sum\limits_{k = 1}^{N} {{\text{bibc}}_{lk} \cdot \left( {q_{k}^{{z,{\text{L}}}} - q_{k}^{{z,{\text{G}}}} } \right)} } , \\ & = - 2 \cdot \sum\limits_{l = 1}^{N} {\sum\limits_{y = a,b,c} {r_{l}^{zy} } \cdot {\text{bibc}}_{li} \cdot Q_{l}^{z} } , \\ \end{aligned}$$
(44)
$$\begin{aligned} \frac{{\partial f_{\text{V}} }}{{\partial q_{i}^{{z,{\text{G}}}} }} & = 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{OVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{max} } } \right) \cdot } } X_{ki}^{xz} , \\ & \quad + 2 \cdot \sum\limits_{k = 1}^{N} {\sum\limits_{x = a,b,c} {{\text{UVF}}_{k}^{x} \cdot \left( {V_{k}^{x} - V_{k}^{\hbox{min} } } \right) \cdot } } X_{ki}^{xz} . \\ \end{aligned}$$
(45)

5 Proposed ARMU

Figure 2 shows distribution network in which GMCMs and LMCMs are installed besides ARMUs in generation and load buses. The main role of GMCM is controlling the operating point of DGs. This control unit includes internal controller block and communication devices to receive signal from ARMUs all over the network. Moreover, LMCMs control the amount of loads based on ARMU signals to maintain voltage in their normal ranges. For each change in network, LMCMs and GMCMs receive set points from ARMUs. Furthermore, these control units send \(Q(t_{k} )^{\text{NDisp}}\), \(P(t_{k} )^{\text{Disp}}\), \(P(t_{k} )^{\text{NDisp}}\), \(Q(t_{k} )^{\text{Disp}}\) and \(P(t_{k} )^{\text{Load}}\) to ARMUs in order to calculate optimum set points. After applying new operating points to DGs and loads by GMCMs and LMCMs, network voltages change. These new voltages and transmission powers are submitted to ARMUs again. The operations are repeated again and again until the problem converges to optimum response.

Fig. 2
figure 2

Distribution network with GMCMs, LMCMs and ARMUs

Optimization process is done based on APC and RPC separately or simultaneously. In this section, simultaneous APC and RPC are investigated. Equation (46) shows the control variables.

$$u = \left[ {p_{n1}^{\text{L}} ,p_{n2}^{\text{L}} , \ldots ,p_{{n{\text{L}}}}^{\text{L}} ,\quad p_{n1}^{\text{NDisp - G}} ,p_{n2}^{\text{Disp - G}} , \ldots p_{ni}^{\text{Disp - G}} ,q_{ni}^{\text{Disp - G}} , \ldots p_{nj}^{\text{NDisp - G}} ,q_{nj}^{\text{NDisp - G}} ,p_{{n{\text{G}}}}^{\text{G}} } \right]^{\text{T}} .$$
(46)

These control variables are limited as follows:

$$q_{i}^{\text{Disp - G,min}} \le q_{i}^{\text{Disp - G}} \le q_{i}^{\text{Disp - G,max}} \quad i = n1, \ldots ,n{\text{G,}}$$
$$p_{i}^{\text{Disp - G,min}} \le p_{i}^{\text{Disp - G}} \le p_{i}^{\text{Disp - G,max}} \quad i = n1, \ldots ,n{\text{G}} .$$
(47)

Figure 3 shows simultaneous active and reactive power management algorithm.

Fig. 3
figure 3

ARMUs system

In order to perform active and reactive power control separately, the main input signals are \(Q(t_{k} )^{\text{NDisp}}\), \(P(t_{k} )^{\text{Disp}}\), \(P(t_{k} )^{\text{NDisp}}\), \(Q(t_{k} )^{\text{Disp}}\) and \(P(t_{k} )^{\text{Load}}\). The minimization of losses, bus voltage variations, load shedding and power generation variation have been done by the distributed optimization system unit. The suitable output control variables are obtained after optimization operation. The obtained control variables at Kth iteration are \(Q(t_{(k + 1) + i} )^{\text{NDisp - opt}}\), \(P(t_{(k + 1) + i} )^{\text{Disp - opt}}\), \(Q(t_{(k + 1) + i} )^{\text{Disp - opt}}\) and \(P(t_{(k + 1) + i} )^{\text{Load - opt}}\). These values are applied to GMCMs and LMCMs by ARMUs. This algorithm is implemented for active and reactive power control simultaneously. By repeating this loop, optimum active and reactive power is obtained simultaneously.

6 Simulation Results

To validate effectiveness of proposed method, it is applied to IEEE 33 bus network shown in Fig. 4. The network system consists of wind turbines, photovoltaic systems and dispatchable DGs which supply loads. System parameters are given in Candelo Becerra and Hernández Riaño (2013). Each dispatchable DG can work in RPC and APC individually or simultaneously. Non-dispatchable DGs generate their output active power based on their active power curves and can only work in RPC mode. DGs are oversized by 20% more than their active power capacity. The lower and upper acceptable limits for voltage control are set to [0.95–1.05]p.u. The proposed ARMU has been evaluated under different situations such as state A, B and C in distribution network. In the A, B and C, states to demonstrate the validity of the proposed method, the ARMU system is compared with the system without proposed ARMU method. To validate optimality of proposed method, states A and C are also evaluated in a centralized subgradient. It is assumed that point of common coupling bus voltage (V1) is constant in all simulations.

Fig. 4
figure 4

Case study system a state B, b states A and C

In all calculations of active power, the output of controlled sources is equal to the difference in nominal power of cut amount of the generated power of the source.

According to ARMU, the curtailment power of DGs is control variables so reference active power of dispatchable DGs is obtained as follows. Also in all figures output active power of DGs is obtained from the following equations.

$$P_{\text{Rap}} = P_{\text{Aap}} - P_{\text{Cap}} ,$$
(48)

where \(P_{\text{Rap}}\), \(P_{\text{Aap}}\) and \(P_{\text{Cap}}\) are reference active power, available active power and curtailment active power, respectively. The reactive power of DGs is regulated to meet the objective function based on proposed ARMU. Minimum and maximum available reactive powers are obtained as follows:

$$Q_{\text{max,min}} = \pm \sqrt {S_{\text{nominal}}^{2} - P_{\text{Rap}}^{2} } ,$$
(49)

where \(S_{\text{nominal}}\) and \(Q_{\text{max,min}}\) are apparent and maximum/minimum reactive powers, respectively. Usually, finishing data measurement within one cycle (20 ms for 50 Hz system) is not hard. Moreover, the information exchange between two control units and the control update time for each local control and management unit take less than 5 and 1 ms, respectively. Therefore, one step of control update takes less than 25 ms to finish. So, one second is enough for the distribution solution to fulfill one round of update, and it updates the control settings every 1 s until convergence. Actually, the time interval between control update can be set to a very small value, even less than 1 s.

State A In state A, all objective functions are considered simultaneously (wL = 0.06, wV = 0.3, wC = 3 and wS = 15). DG characteristics are given in Table 1. In this state, all DGs are dispatchable in Fig. 1a.

Table 1 Characteristics of DGs in case study system

In addition to the previous assumption, in order to validate the performance of the proposed solution in over voltage condition, it is assumed that at t = 15 s the consumption power increases to 90% of its nominal value and restore. The simulation results for this state are illustrated in Fig. 5. As shown in Fig. 5b, the converged values of the loss objective function with the distributed and centralized solutions are the same at wL = 0.06 and both are significantly lower than the case without control. Moreover, corresponding to Fig. 5b, increment of wL reduces minimum voltage and loss power and makes the speed of convergence worse as the simulation converges in more iterations.

Fig. 5
figure 5

Simulation results for scenario 1: a evolution of active power loss with different control solutions, b minimum voltage of the system with different control solutions

State B In this case, changes in operating conditions are considered as different scenarios. Thus, simulations are conducted in different loading conditions and different levels of DGs’ active power. These changes are used as disturbances, and therefore, the DG units appeared as intermittent sources. The sequence of loading condition and DGs’ active power level is given in Table 2.

Table 2 Sequence of loading condition and DGs’ active power

These sequences are selected based on the fact that the most severe voltage situation occurs when significant amount of generation or load is connected or disconnected. The weight factors 0.05, 0.3, 1 and 15 are set to \(w_{\text{L}}\), \(w_{\text{V}}\), \(w_{\text{C}}\) and \(w_{\text{S}}\), respectively. Two scenarios are designed with the system. In both scenarios, it is assumed that DGs are dispatchable units. Scenario 1 considers that DGs are located on bus 2, 3, 6, 10, 12, 15, 17, 18, 19, 22, 27, 30 and 31. Scenario 2 considers that DGs are located on bus 2, 3, 6, 12, 15, 17, 22 and 31. In two scenarios, proposed distributed solution results are analyzed in two modes. In the first mode, ARMU defines reference reactive power of DGs with distributed subgradient RPC. In the second mode, ARMU defines reference reactive power of DGs, reference active power of DGs and reference active and reactive load shedding distributed subgradient with RPC and APC simultaneously. System characteristics are given in Table 3. Case study system in Fig. 1a is simulated in this state.

Table 3 Characteristics of DGs in case study system

Scenario 1 In this scenario, the control variables for this system include reactive and active power set points of 13 DG units previously installed in the system according to scenario 1 of table. In the following, control processing is begun at t = 1 s. DGs curtail their active power continuously and load shedding is done discreetly so that active power load has been cutoff with 5 kW steps. For each 5 kW, 2.5 kVAr reactive power of load is also shaded. The evaluation of active power loss objective function is depicted in Fig. 6a. Minimum and maximum of voltage profiles are presented in Fig. 3b, c, respectively. The active and reactive load shedding and the active power curtailment of DGs are, respectively, shown in Fig. 7a–c. When the generated active power of DGs is raised to its maximum capacity at t = 10 s, voltage profile is not violated admissible range. In this case, DGs try to reduce active power loss by RPC. Network maximum voltage exceeds its limit when the consumption power diminishes to 10% of its nominal value at t = 20. After elapsing time delay, ARMU curtails active power dispatchable DGs in the less 2 s to eliminate voltage violation. Totally active power curtailment is 416.8 Kw from 3600 Kw available active power of dispatchable DGs in this situation. However, in the first mode the DGs with only RPC cannot restore the network voltage in admissible range. Because of no control in active power of generation and consumed, DGs try to eliminate voltage violation. Thus, the active power loss is increased transiently. In the second mode, because the generation active power is decreased by ARMU, also the losses are decreased. When the generated active power of DGs is lowered to 10% of its maximum capacity at t = 30 s, voltage profile remains in the acceptable limits. At t = 40 s, the consumption power is increased to its nominal value and network voltage profile decreases severely. In this situation, the first mode tries to improve minimum value of voltage profile, but their generation reactive power is not adequate to restore network voltage in admissible range. As can be seen with second mode, this problem will be solved and load shedding is occurred. Totally active and reactive power shedding is 1037.1 Kw and 480.5 KVAr from 3715 Kw and 2240 available consumed active and reactive power, respectively. Thus, second mode can maintain voltage in acceptable range and has lower losses than first mode.

Fig. 6
figure 6

Simulation result of for ARMU with only RPC, ARMU with APC and RPC simultaneously and system without ARMU a evolution of active power loss, b maximum voltage of the system, c minimum voltage of the system

Fig. 7
figure 7

Simulation result of DGs for ARMU with only RPC, ARMU with APC and RPC simultaneously and system without ARMU a evolution of active power shedding, b evolution of reactive power shedding, c evolution active power curtailment

Total active and reactive power shedding is depicted in Fig. 7. The percentage of each load shedding has been determined based on the proposed method in ARMU so that voltage variation is within the allowed range and power loss is minimum.

Output active power of DG17, DG18, DG12 and DG3 is shown in Fig. 8a–d respectively. In regard to ARMU, output active power of DG12, DG17, DG18, DG19 and DG31 is defined by second modes. In the second mode in time interval t ∈ [20 30], DGs decrease their active power based on ARMU commands to decrease sudden voltage violation.

Fig. 8
figure 8

Simulation result of curtailment active power of DGs by ARMU with only RPC, ARMU with APC and RPC simultaneously a at bus 17, b at bus 18, c at bus 12, d at bus 3

Output reactive power of DG2, DG3, DG12 and DG17 is defined by first and second modes in Fig. 9a–d, respectively. In both of modes in time interval t ∈ [20 30], DGs consumed reactive power to decrease sudden overvoltage and in time interval t ∈ [40 50], DGs generated their maximum reactive power to compensate sever drop voltage.

Fig. 9
figure 9

Simulation result of generation reactive power of DGs by ARMU with only RPC, ARMU with APC and RPC simultaneously a at bus 2, b at bus 3, c at bus 12, d at bus 17

In time interval t ∈ [40 50], ARMU defines the share of each load in load shedding to compensate sever drop voltage. Figure 10a–d shows active load shedding at bus 6, 18, 27 and 30. Figure 8a–d shows reactive load shedding at bus 6, 18, 27 and 30 (Fig. 11).

Fig. 10
figure 10

Simulation result active power shedding by ARMU with only RPC, ARMU with APC and RPC simultaneously a at bus 6, b at bus 18, c at bus 17, d at bus 30

Fig. 11
figure 11

Simulation result reactive power shedding by ARMU with only RPC, ARMU with APC and RPC simultaneously a at bus 6, b at bus 18, c at bus 17, d at bus 30

Scenario 2 According to scenario 2 of Table 3, distribution network is analyzed by two mentioned modes in scenario 1 and with no ARMU. The number of dispatchable DGs is fewer than scenario 1, so more load shedding is occurred. The evaluation of active power loss objective function is depicted in Fig. 12a. Minimum and maximum of voltage profiles are shown in Fig. 12b, c, respectively. The active and reactive load shedding and the active power curtailment of DGs are, respectively, shown in Fig. 13a–c. At t = 1 s, consumption power is more than generation of DGs. In this situation, the first mode attempts to make better the minimum value of voltage profile, but their generation reactive power is not enough to restore the network voltage in admissible range. As can be seen with second mode, this problem will be solved and load shedding is occurred. When the generated active power of DGs is raised to its maximum capacity at t = 10 s, the shaded loads is reconnected again to system. In this case, DGs try to reduce active power loss by RPC. When the consumption power diminishes to 10% of its nominal value at t = 20, network maximum voltage exceeds its limit. The first mode can restore network maximum voltage in acceptable range. Also second mode with RPC can do it. When generated active power of DGs is lowered to 10% of its maximum capacity at t = 30 s, voltage profile remains in the acceptable limits. At t = 40 s, the consumption power is increased to its nominal value and network voltage profile decreases severely. In this situation, system control operation is analyzed same t ∈ [40 50] of first scenario. In this state, simulation result shows that operation system with proposed ARMU is better than without ARMU.

Fig. 12
figure 12

Simulation result of for ARMU with only RPC, ARMU with APC and RPC simultaneously and system without ARMU: a evolution of active power shedding, b evolution of reactive power shedding, c evolution active power curtailment

Fig. 13
figure 13

Simulation result for ARMU with only RPC, ARMU with APC and RPC simultaneously and system without ARMU: a evolution of active power shedding, b evolution of reactive power shedding, c evolution active power curtailment

According to Table 4, total generation, consumed and loss active power during 50 s is obtained by ARMU with APC and RPC simultaneously, ARMU with only RPC and system without ARMU for scenarios 1 and 2. Since the number of DGs in scenario 1 is more than one, the load shedding active power of the scenario 1 is less and the loss active power is more than scenario 1. In both scenarios, minimum and maximum power loss is, respectively, obtained by ARMU with RPC and APC simultaneously and without ARMU. According to Table 5, curtailment generation power and load shedding power are implemented by APC in ARMU. For both scenarios, the worst-case situation with two large disturbances occurs at 20 and 30 s. So sudden voltage change occurs. Steady voltage at t ∈ [20 30] and [40 50] for system operation mode is demonstrated in Table 5. According to Table 5, minimum voltage drop and maximum over voltage of system in steady are, respectively, obtained by ARMU with RPC and APC simultaneously and without ARMU.

Table 4 Comparison system operation mode with ARMU by RPC and APC simultaneously, ARMU only by RPC and without ARMU for both scenarios during t ∈ [0 50] s
Table 5 Characteristics of DGs in case study system

State C In this state, DGs at buses 2, 3, 6, 15 and 25 are non-dispatchable units. Also there are two dispatchable DGs on buses 12 and 17. DG characteristics are given in Table 5. Simulation is run for a period of 24 h and half-hourly intervals. Iterations of optimization processing are 200 running at the beginning of the half-hourly interval. The control variables for this system include reactive power set points of DG2 and DG3, active power set points of DG12, DG17 and DG31 and active power set points of all loads. ARMU at buses 2 and 3 defines reference reactive power of DGs with RPC mode. ARMU at buses 18, 22 and 31 defines reference active power of DGs with APC modes. ARMU at buses 12 and 17 defines reference active and reactive power of DGs with APC and RPC simultaneously mode. Case study system in Fig. 1b is simulated in this state.

In this state, solar and wind power plants generate their active power based on the curve shown in Fig. 14. Since DGs are not too far from each other, this curve is identical for all DGs. Scale coefficients of wind and photovoltaic generations as well as loads are shown in Fig. 14 for a period of 24 h and half-hourly intervals (Fig. 15).

Fig. 14
figure 14

Normalized active power of wind turbine, photovoltaic and load curve during 24 h

Fig. 15
figure 15

Simulation result for ARMU with distribution subgradient, ARMU with centralized subgradient and system without ARMU: a evolution of active power shedding, b evolution of reactive power shedding, c evolution active power curtailment

Active power loss objective function is depicted in Fig. 16a. Minimum and maximum of voltage profiles are shown in Fig. 16b, c, respectively. The initial conditions for all methods are the same. As shown in Fig. 16b, c, the minimum and maximum voltage variation in ARMU with distributed subgradient gives better response than in ARMU with centralized subgradient ones and with no ARMU. Moreover, according to Table 6, the network power losses during 24 h with the ARMU with distributed sub solution are less than others.

Fig. 16
figure 16

Simulation result for ARMU with distribution subgradient, ARMU with centralized subgradient and system without ARMU: a evolution of active power loss, b maximum voltage of the system, c minimum voltage of the system

Table 6 The network power losses during 24 h

The active and reactive load shedding and the active power curtailment of DGs are, respectively, shown in Fig. 16a–c. Shedding and curtailment power is applied when there is not enough generation active power and extra generation active power, respectively. In this state, the shortage of power demand is compensated by the main grid so that load shedding is not required.

Output reactive power of DG2, DG3, DG12 and DG17 is demonstrated by ARMU with distribution subgradient, ARMU with centralized subgradient and system without ARMU in Fig. 17a–d, respectively.

Fig. 17
figure 17

Simulation results generation reactive power of DGs for ARMU with distribution subgradient, ARMU with centralized subgradient and system without ARMU a at bus 2, b at bus 12, c at bus 3, d at bus 17

Also, simulation result shows that operation system via ARMU with distribution and centralized subgradient is better than without ARMU.

Following points are deduced from case study simulation:

  • In some cases, the voltage deviation between network maximum and minimum voltages is the highest. Therefore, only the RPC might not be sufficient to restore all network voltages to an acceptable level and therefore other control actions like APC of DGs and loads would be applied.

  • ARMU obtains optimum set point of DGs and loads in each bus to minimize system loss. Also, system loss by ARMU in comparison with APC and RPC is less.

  • ARMU coordinates DGs and loads in online optimization without control center.

7 Conclusion

Optimal power management technique is an essential task in the future distribution networks according to the penetration level increment of intermittent DGs. In this paper, voltage sensitivity matrix of the distribution network has been presented as an overview of active power control management and reactive power control management separately and ARMU. GMCMs and LMCMs have been used for primary control DGs and loads with essential parameter measurements, respectively. The proposed ARMUs calculate optimum set points and send to GMCMs and LMCMs. Distribution subgradient method is employed in ARMU to optimize distribution network based on minimization of loss, buses’ voltage variation, load shedding and variation of power generation. The proposed ARMU has been evaluated various conditions situations such as states A, B and C in distribution network. In the state B, simulation results show effectiveness ARMU in comparison with APC and RPC to regulate voltage profile and minimize system loss. In the state C, proposed distribution power management has been compared to centralize one. Compared to the centralized method, the results showed the ability of the proposed distributed method for successful voltage regulation and network loss reduction in an admissible time required for online computations. The proposed method has a high ability to regulate voltage profile of the distribution network by simultaneous active and reactive power control of DGs.