1 Introduction

There is a great challenge in electricity due to the introduction of smart grid concept. The distributed generation with renewable energy resources integration has become the major part of smart grid. The greatest challenge in the smart grid environment is to reduce the system power loss and improve the bus voltage profile which in turn will help the customers to reduce the total cost incurred. The varying demand is very normal in distribution system, so it is necessary to consider generation system with varying load conditions. The demand side management satisfies the varying demand based on consumer participation in choice of power generation. DSM makes the customer to get cheaper power generation by choosing the power generation and by reducing their demand. The reactive power optimization problem reduces the power loss in power system and improves the voltage profile in the system. Nowadays, the smart grid paradigm is considered an adequate beacon of energy policies to support the modernization of the electricity sector (De Oliveira-De Jesus and Henggeler Antunes 2018). The smart grid is an intelligent power grid to optimize the production, distribution and consumption of electricity. It supports steady delivery and demand on the electric grid (Marah and El Hibaoui 2018). The SG technology is undertaking a transformation from a centralized, producer-controlled network to less centralized and more consumer-interactive network, thereby reducing the cost of electrical power distributed to the end users (Wang et al. 2014; Abdollahi et al. 2012). Cost and emission reduction, decrease in fuel dependency, increase in power system reliability, and increase in revenue are some of the benefits of implementing demand response (DR) programs in smart grid (Jarrah et al. 2015; Ma et al. 2016). However, existing mathematical models developed for DSM at typical consumer premises mostly considers minimization of electricity cost, thereby resulting in usage of increased load at low price hours (Razmara et al. 2018).

In SG, it is assumed that more DGs are installed on the side of residential customers owing to environmental concerns (Guo et al. 2012). The necessity for implementing solutions in distribution networks using advanced technologies, such as sensing, data processing, automatic control, and communications, is growing rapidly due to a continued shift toward distributed and variable DGs (El-Sharafy and Farag 2017). A smart grid constitutes the improvement of a traditional electrical distribution system, which is conceived to overcome the problem of the wide diffusion and high penetration of DGs (Possemato et al. 2016). The DG has the promise of reduced greenhouse emission, increased efficiency, and improved reliability (Rahbari-Asr et al. 2016).

The structure and nature of techniques that have been developed for power system reliability analysis and evaluations are not applicable for interdependent cyber-power networks as these networks exhibit crucial differences. The indirect interdependencies cause potential failures which need to be updated (Falahati et al. 2012). A decentralized optimal reactive power control (ORPC) scheme (Ansari et al. 2016) in smart grid is a good control scheme for power system optimization. The main objective of ORPC is to reduce active power losses in the system and to improve voltage profile. The concept of OPRC increases the complexity of the problem since data received locally with assumptions used for solving the problem reduced the accuracy of the results (Zhang et al. 2014). Various schemes have been proposed to solve this problem, and these may be categorized into centralized and decentralized (distributed) schemes (Mian et al. 2018). Di Santo et al. (2018) presented demand side management system for household. For increasing load in the distribution system, the electricity costs of household get increased. In order to reduce the electricity cost in the house hold active demand side management using ANN (Artificial neural network) is adopted. The energy storage device operates maximum to reduce the cost which has limitation when implementing in large distribution system. Marzband et al. (2017) proposed that energy management system reduced the production cost by incorporating the renewable energy resources and made the consumer to participate in the smart grid technology. An artificial neural network combined with a Markov chain (ANN-MC) is applied for optimal generation with uncertainties in load demand and modified artificial bee colony algorithm is proposed for energy management system. For centralized schemes, the approaches are dynamic programming (Zhang et al. 2016), PSO (Moradi et al. 2015), evolutionary algorithms (Senjyu et al. 2008) and others. A highly functional semi-decentralized power matching framework based on multi-objective optimization techniques executing in a day-ahead electricity market has been introduced by Azar et al. (2018). Najafi-Ghalelou et al. (2018) have presented an optimal energy management of interconnected multi-smart apartment buildings considering energy flow and thermal exchange. The power exchange and thermal exchange between the smart building increases the life enhancement of thermal storage, thereby reducing the total operation cost.

An intelligent park micro-grid consisting of photovoltaic power generation, combined cooling heating and power system, energy storage system and response load was modeled to study the optimal scheduling strategy of these units by taking into account the price-based demand response as presented by Wang et al. (2018a). An evolutionary simulation–optimization framework to implement an interruptive DR strategy on a smart grid with uncertain device loads has been presented by Bastani et al. (2018). An agent-based solution that takes into consideration the user’s loss minimization in the smart grid context has been proposed by Klaimi et al. (2018). An energy management optimization with micro-grids was presented by van Ackooij et al. (2018). An efficient and privacy-preserving power usage control protocols that allow a utility company to balance supply and demand in a smart grid without violating personal privacy of its customers have been developed by Chun Hu et al. (Hu et al. 2018). The reactive power optimization reduces the real power loss and improves system voltage profile (Zhang et al. 2018). In order to reduce the cost, the introduction of renewable energy system in smart grid is done by integrating demand side management and active management schemes (Cecati et al. 2011). Elephant herd optimization algorithm is proved to give better performance compared to other heuristic optimization algorithm (Wang et al. 2016). The heuristic optimization techniques (Tang and Gong 2019; Wang et al. 2018c; Zhao et al. 2018; Abualigah 2019; Abualigah et al. 2019) can be applied for multi-objective function with constraints to get better performance compared with analytical methods.

Several studies have been carried out in dynamic energy management in micro-grid and smart grid applications. The detailed review of recent research works shows that the optimization of power in SG reduces the generation cost while considering the DSM of the consumers. An optimal energy management problem in the SG was performed by taking into account customers uncertain load demands, distributed renewable energy resources and energy storage devices. Specifically, an electric power distribution network consisting of a set of energy users has two-way real-time communications with a utility company. The optimal schedule should minimize the system costs and losses during the study period, while satisfying load demand, spinning reserve requirements, and the physical as well as operational constraints of each individual unit. Several deterministic, heuristic and hybrid methods have been proposed in the last decades for solving demand side management problem formulated as an optimization problem. Deterministic methods, in general, are unable to find a solution within the available timeframe when the problem is medium or large size. These limitations introduced the heuristic methods for finding better solutions. A heuristic optimization algorithm is used to solve all complicated optimization problem; however, the main drawback of heuristic methods is that they cannot guarantee the optimal solution.

In this paper, a smart controller is proposed for solving demand side management which is formulated as an optimization problem. DSM is addressed as economic dispatch problem considering generation and responsive load offers. EHO–FF is proposed to solve the optimization problem in DSM, which includes the conventional equality and inequality constraints (supply and demand balance constraints, limiting constraints such as bus voltage, line flow limit and reactive power limit). The reactive power optimization concentrates on optimization of reactive power by enhancing the system voltage profile, energy efficiency and minimizing real power loss in the transmission network. The proposed method is implemented in IEEE 30 bus benchmark test system considering different operating scenarios for optimal solution of reactive power.

In this work, a smart controller is proposed for economic dispatch considering generation and responsive load offers. It is utilized to improve the energy efficiency and voltage profiles of the power grids under different operating conditions based on optimal reactive control solution.

The main contribution of this paper is as follows:

  1. 1.

    To develop a smart controller to cater the needs of demand side management in smart grid.

  2. 2.

    To formulate DSM as an optimization problem and to obtain its solution using appropriate evolutionary algorithm.

  3. 3.

    To minimize real power loss, by optimal sizing of DG units at identified location using EHO–FF algorithm, thereby enhancing the voltage profile.

The rest of the paper is organized as follows. Sect. 2 describes the proposed smart controller with detailed mathematical problem formulation. Section 3 discusses the EHO–FF algorithm, and its implementation in the proposed smart controller. Detailed simulation studies and comparison of results are provided in Sect. 4. Section 5 draws the major conclusions highlighting the research contributions and scope for future work.

2 Proposed methodology

This section gives a detailed explanation of problem for the proposed smart controller used for reactive power optimization (RPO) in smart grid. The RPO is used to develop voltage control strategy at steady state conditions. Figure 1 shows the block diagram of the proposed smart controller. The reactive power control is achieved using EHO–FF optimization algorithm for the test system under study subjected to varying load patterns. The EHO–FF algorithm aims to minimize the power loss by optimal sizing of DG units. The existing demands of the system and all the DG buses are determined in advance. It gives the optimal objective value (e.g., DG value, the real power losses and the voltage magnitude deviation) under the physical constraints (including the limitations of the reactive power generation at generator and slack buses, the output of the capacitors, and the ratios of the transformers) and the operating constraints (including the bound limits of the voltage magnitude of buses except the slack bus).

Fig. 1
figure 1

Block diagram of the proposed method

2.1 Objective function of RPO

The RPO incorporates the active and reactive power balance equations at each bus, as well as physical and operating constraints. Its objective function is the minimization of the power loss \( \left( {P^{\text{loss}} } \right) \) which is expressed in Eq. (1),

$$ \hbox{min} \left( {P^{\text{loss}} } \right) = \mathop \sum \limits_{i \in S} \mathop \sum \limits_{j \in S} V_{i} V_{j} G_{ij} \cos \theta_{ij} $$
(1)

Here, the voltage magnitude of the bus \( i \) is \( V_{i} \), the voltage magnitude of the bus \( j \) is \( V_{j} \), the conductance among buses \( i \) and \( j \) is \( G_{ij} \), the voltage angle among buses \( i \) and \( j \) is \( \theta_{ij} \) and \( S \) is the total number of branches in the network (Zhang et al. 2018).

The power flow equations are shown in Eqs. (2) and (3),

$$ \left\{ {\begin{array}{*{20}l} {P_{i}^{G} - P_{i}^{L} - P_{i} = 0;} \hfill & {i \in S^{G} } \hfill \\ {Q_{i}^{G} - Q_{i}^{L} - Q_{i} = 0;} \hfill & {i \in S^{G} } \hfill \\ \end{array} } \right. $$
(2)
$$ \left\{ {\begin{array}{*{20}l} { - P_{i}^{L} - P_{i} = 0;} \hfill & {i \in S^{L} } \hfill \\ {Q_{i}^{C} - Q_{i}^{L} - Q_{i} = 0;} \hfill & {i \in S^{L} } \hfill \\ \end{array} } \right. $$
(3)

Here \( i{\text{th}} \) generator bus active power is denoted as \( P_{i}^{G} \), the \( i{\text{th}} \) load bus active power is denoted as \( P_{i}^{L} \) and \( P_{i} \) is \( i{\text{th}} \) bus active power. Then the \( i{\text{th}} \) generator bus reactive power is denoted as \( Q_{i}^{G} \), the \( i{\text{th}} \) load bus active power is denoted as \( Q_{i}^{L} \), \( Q_{i} \) is \( i{\text{th}} \) bus active power. The \( S^{G} \) is the total number of generator branches in the network, and \( S^{L} \) is the total number of generator branches in the network.

The output limitations of the reactive power generation, capacity limits of the static VAR compensators, acceptable operating ranges of the voltage magnitude (except for the slack bus), and constraints of the tap positions of transformers \( \left( {T_{l} } \right) \) are given in Eq. (4)

$$ \left\{ {\begin{array}{*{20}l} {\hbox{min} \left( {Q_{i}^{G} } \right) \le Q_{i}^{G} \le \hbox{max} \left( {Q_{i}^{G} } \right);} \hfill & {i \in S^{G} } \hfill \\ {\hbox{min} \left( {Q_{i}^{C} } \right) \le Q_{i}^{C} \le \hbox{max} \left( {Q_{i}^{C} } \right);} \hfill & { i \in S^{C} } \hfill \\ {\hbox{min} \left( {V_{i} } \right) \le V_{i} \le \hbox{max} \left( {V_{i} } \right);} \hfill & {i \in S^{G} \cup S^{L} } \hfill \\ {\hbox{min} \left( {T_{l} } \right) \le T_{l} \le \hbox{max} \left( {T_{l} } \right);} \hfill & { l \in S^{T} } \hfill \\ \end{array} } \right. $$
(4)

where

$$ \left\{ {\begin{array}{*{20}l} {P_{i} = V_{i} \mathop \sum \limits_{j \in S} V_{j} \left( {G_{ij} \cos \theta_{ij} + B_{ij} \sin \theta_{ij} } \right)} \\ {Q_{i} = V_{i} \mathop \sum \limits_{j \in S} V_{j} \left( {G_{ij} \cos \theta_{ij} - B_{ij} \sin \theta_{ij} } \right)} \\ \end{array} } \right. $$
(5)

Here, the mutual susceptance between bus \( i \) and \( j \) is denoted as \( B_{ij} \). As described in all optimization problems, the variables of the RPO are classified as state variables (which includes the bus angles, voltage magnitude of the load buses, reactive power of the generator buses, and real power generation of the slack bus) and control variables (which includes voltage magnitude of the generator buses, output of the shunt capacitors/reactors, and the ratios of the transformers). In order to express them more conveniently, the bus order of the system is assumed to be the slack bus, generator buses, and load buses (load buses with shunt capacitors/reactors come earlier in the order). Based on this order, the state variable vector \( \left( X \right) \) is given as Eq. (6),

$$ X = \left[ {P_{1}^{G} ,Q_{1}^{G} , \ldots ,Q_{m}^{G} V_{m + 1} , \ldots ,V_{n} \theta_{2} , \ldots ,\theta_{n} } \right]^{\text{T}} $$
(6)

And also the control variables \( \left( U \right) \) are described as Eq. (7),

$$ U = \left[ {V_{2} , \ldots ,V_{m} Q_{m + 1}^{C} , \ldots ,Q_{m + r}^{C} T_{1} , \ldots ,T_{k} } \right]^{\text{T}} $$
(7)

Because the RPO concentrates on the optimization of the reactive power and voltage profile, some constraints incorporated in the optimal power flow have been removed, such as the constraints of the real power line flow and the real power generation of the slack bus. The active power generation is known. The ratios of the transformers and shunt capacitors/reactors are discrete variables in practice, and this problem can be effectively solved by introducing the penalty function.

It is noted that there are all kinds of uncertain factors in the input data of the RPO, thus making it an uncertain nonlinear programming problem, the uncertainty of which can be expressed as a fuzzy number, random number, and interval. In this paper, the intervals are chosen to describe the uncertainties in the RPO model due to its self-validated computation. The bound information of the uncertainty is easier to obtain through engineering practices. The uncertainties associated with active and reactive power variations are more significant than other types of uncertainties such as uncertainties of the transmission line parameters. However, in this work only the uncertainties of the active power generation and load demand are considered (Cecati et al. 2011). For easier comprehension, the active power generation is described by Eq. (8),

$$ \left[ {P_{i}^{G} \left( {SL} \right),P_{i}^{G} \left( {SU} \right)} \right]\;{\text{for}}\; i \in S^{G} $$
(8)

Active power demand is denoted as Eq. (9),

$$ \left[ {P_{i}^{L} \left( {SL} \right),P_{i}^{L} \left( {SU} \right)} \right] \;{\text{for}}\; i \in S^{L} $$
(9)

And the reactive power demand is evaluated as Eq. (10),

$$ \left[ {Q_{i}^{L} \left( {SL} \right),Q_{i}^{L} \left( {SU} \right)} \right]\;{\text{for}}\; i \in S^{L} $$
(10)

Moreover, it is assumed that the active and reactive power load of the slack and generator buses are deterministic values since they are mainly derived from power plants. After the formulation of the balance equations with the interval uncertainty, the model of the RPO as given

$$ \hbox{min} f\left( {X,U} \right) = \left[ {f^{L} ,f^{U} } \right] $$
(11)
$$ h\left( {X,U} \right) = \left[ {h^{L} ,h^{U} } \right] $$
(12)
$$ \hbox{min} \left( g \right) \le g\left( {X,U} \right) \le \hbox{max} \left( g \right) $$
(13)

Here the interval functions are described as \( f\left( {X,U} \right),h\left( {X,U} \right) \) and \( g\left( {X,U} \right) \), the interval of the real power losses is \( \left[ {f^{L} ,f^{U} } \right] \) and an interval vector of the power flow variation is denoted as \( \left[ {h^{L} ,h^{U} } \right] \). The state and control variable vectors \( X \) and \( U \) are corresponding to \( X \) and \( U \) of the RPO model, respectively. In the proposed model \( U \) is a vector with real values because the voltage magnitude of the generators is fixed by the excitation system. The output of the shunt capacitors/reactors and the ratios of the transformers are also coordinated manually. Unlike \( X,U \) is composed of interval values, this is due to its uncontrolled feature under the interval input data. In addition, \( X \) is always decided by U through the combination of the interval power flow equations, i.e., for each U, there is a corresponding \( X \). Obviously, the problem is found to be addressed by means of the nonlinear programming problems with interval uncertainty. The linear approximation method with internal control has been used in the deterministic RPO model. To improve its accuracy further, the proposed smart controller serves to be a better method for obtaining the intervals of the uncertain power flow equations. The implementation of the smart controller for RPO model is discussed in detail in next section.

3 Smart controller for reactive power optimization

In this section, the concept of the smart controller is described for controlling the reactive power based on the load demands. The smart controller utilizes the EHO algorithm, but the searching behavior of the EHO has less performance. The searching behavior of the EHO algorithm is enhanced by using the FF algorithm. The smart controller controls the power losses and optimizes the reactive power under different load scenarios. The procedure of the smart controller is simple in concept, ease in implementation, and efficient in computation in terms of both memory requirements and speed. By default in the toolbox of MATLAB, the values of all the parameters such as the size of a swarm, inertia coefficient, factors of attraction have been defined. The EHO parameters will be updated automatically based on the optimal solution.

3.1 The optimization process of EHO

In the search space, the EHO is a swarm-based heuristic algorithm as finding an optimal solution. Generally, a matriarch in each clan is the eldest one and can be visualized as the fittest elephant individual in this clan as optimization problem. Herding behavior of elephants is measured as two operators are clan updating operator and separating operator, the detailed steps of EHO are specified as follows.

3.1.1 Clan updating operator

As stated, each elephant lives together under the leadership of a matriarch in all clan. So, every elephant in the clan \( ci \), next position is influenced by a matriarch \( ci \). Once separating the worst values from the population, the fittest values are updated using the clan updating operator and worst values are rejected. For the elephant \( j \) in the clan \( ci \) can be updated using Eq. (14),

$$ x_{ci,j}^{new} = x_{ci,j} + \alpha \times \left( {x_{ci}^{best} - x_{ci,j} } \right) \times r $$
(14)

where \( x_{ci,j}^{new} \) and \( x_{ci,j} \) are newly updated and old position for the elephant \( j \) in the clan \( ci \), correspondingly. The scale factor is \( \alpha \in [0,\,1] \) which determines the influence of matriarch \( ci \) on \( x_{ci,j} \). The best matriarch \( ci \) is denoted as \( x_{ci}^{best} \) in which the fittest elephant is individual in the clan. r ∈ [0, 1] is a type of stochastic distribution that can increase the diversity of population in the advanced search phase. Uniform distribution is used for existing work (Wang et al. 2016). It should be noted that the fittest elephant in all clan cannot be updated. To avoid this situation for the fittest elephant can be updated in Eq. (15),

$$ x_{ci,j}^{new} = \beta \times x_{ci}^{center} $$
(15)

where β ∈ [0, 1] is a factor which determines the influence of the \( x_{ci}^{center} \) on \( x_{ci,j}^{new} \). The new individual \( x_{ci,j}^{new} \) is produced by the information is found by each elephant individual in the clan \( ci \). The center of the clan \( ci \) is explained as \( x_{ci}^{center} \) and for the \( d^{th} \) dimension can be calculated in Eq. (16),

$$ x_{ci,d}^{center} = \frac{1}{{n_{ci} }} \times \sum\limits_{j = 1}^{{n_{ci} }} {x_{ci,j,d} } $$
(16)

Now, \( x_{ci,d}^{center} \) signifies \( d{\text{th}} \) dimension and \( D \) is a total dimension. The number of elephants in the clan \( ci \) is \( n_{ci} \). The \( d{\text{th}} \) elephant individual \( x_{ci,j} \) is \( x_{ci,j,d} \).

3.1.2 Separating operator

Separating operator is used to separate the worst and fittest value. By using separating operator of EHO, the worst elephant is separated from the clan. When they reach puberty in the elephant group, male elephants will leave their family group and live alone. When solving optimization problems, this separating process can be formed as separating operator (Meena et al. 2017). To improve the searchability of the EHO method, it is assumed that the elephant individuals with the worst fitness will apply the separating operator at all generation as indicated in Eq. (17),

$$ x_{ci}^{worst} = x^{\hbox{min} } + \left( {x^{\hbox{max} } - x^{\hbox{min} } + 1} \right) \times rand $$
(17)

Now, \( x^{\hbox{max} } \) and \( x^{\hbox{min} } \) are upper and lower bound of the position of elephant individual. The worst elephant individual in the clan \( ci \) is labeled as \( x_{ci}^{worst} \). The stochastic distribution is \( rand \in [0,\,1] \) and uniform distribution in the range [0, 1] is used in existing work.

3.1.3 Elitism strategy

As with other meta-heuristic algorithms, a type of elitism strategy is used with caring the best elephant individuals being ruined by clan updating and separating operator. At first, the best elephant individuals are saved and the worst ones are swapped by the saved best elephant individuals at the end of the search process. This elitism strategy guarantees that the later elephant population is not always worse than the previous one. This searching behavior process can be improved by the FF algorithm. The proposed smart controller flow diagram is shown in Fig. 2. The searching behavior optimization is described in the next section.

Fig. 2
figure 2

Flow chart of the Enhanced smart controller

3.2 Development of searching behavior using firefly algorithm

The FF algorithm is an original nature-inspired meta-heuristic algorithm that solves the continuous multi-objective optimization problems based on the social behavior of fireflies. The brightness of the firefly is the main feature of the algorithm and is equal to the objective function in consideration. Three main assumptions are made in proposing the algorithm.

  • All fireflies are unisexual, i.e., one firefly will be attracted by others

  • Attraction is reliant on the amount of brightness, i.e., less bright firefly is attracted to a brighter one.

  • The brightness of the firefly is equal to an objective function.

In the section, an FF algorithm is used as managing the filter elements and degrading the harmonic distortion of the system. From the system inputs, error voltage, changes in error voltage and equivalent outputs of the system are obtained. The reduced noise is valued based on the output. In FF algorithm, two important issues occur, namely variation in light intensity \( I \) and the formulation of the attractiveness \( \beta \) (Wang et al. 2018b). Considering a fixed light absorption coefficient \( \gamma \), the light intensity differs with distance \( r \) as stated in Eq. (18),

$$ I(r) = I_{0} \exp ( - \gamma r^{2} ) $$
(18)

Now, \( I_{0} \) is light intensity at \( r = 0 \). Considering the firefly’s attractiveness as proportional to the light intensity is seen by adjacent fireflies, the attractiveness can be stated in Eq. (19),

$$ \beta (r) = \beta_{0} \exp ( - \gamma r^{2} ) $$
(19)

Now, \( \beta_{0} \) is attractiveness at \( r = 0 \). The distance among any two fireflies \( i \) and \( j \) at \( x_{i} \) and \( x_{j} \), correspondingly, can be calculated using the Euclidean distance in Eq. (20),

$$ r_{ij} = \left\| {x_{i} - x_{j} } \right\| = \sqrt {\sum\limits_{d \in D} {\left( {x_{i,d} - x_{j,d} } \right)^{2} } } $$
(20)

Now, \( x_{i,d} \) is \( d{\text{th}} \) component of the spatial coordinates \( x_{i} \) of the \( i{\text{th}} \) firefly, \( x_{j,d} \) is the dth component of the spatial coordinates \( x_{j} \) of the \( j{\text{th}} \) firefly, and D is the dimension of the problem (Lieu et al. 2018). The movement of firefly \( i \) to another is more attractive (brighter) than firefly \( j \) and can be stated in Eq. (21),

$$ x_{i}^{k + 1} = x_{i}^{k} + \beta_{0} \exp ( - \gamma r_{ij}^{{k^{2} }} )\left( {x_{j}^{k} - x_{i}^{k} } \right) + \alpha \psi_{i} $$
(21)

Now, \( \alpha \) is the randomization parameter, k is the iteration number and \( \psi_{i} \) is a vector of random numbers with Gaussian or uniform distributions. The optimization process is contingent on the brightness of the fireflies and the movement of fireflies to brighter counterparts. Each firefly is attracted to other depending on brightness as the fireflies are unisexual along with the first assumption about artificial fireflies. Except the first step, all routines are repeatedly carried out till an optimization process terminates.

4 Results and discussion

In this section the simulation results of the proposed work are discussed in detail. The program code for reactive power optimization in smart grid by placing DG units at optimal location as given by smart controller has been developed with Intel(R) Core(TM) duo processor, 4 GB RAM in MATLAB 7.10.0 (R2015a) platform.

To validate the effectiveness of the smart controller, the benchmark IEEE 30 bus system is considered, whose single line diagram is shown in Fig. 3. The test system consists of six generating units interconnected with a transmission network comprising of 41 branches with a total load of 283.4 MW and 126.2 MVAR. Initially, the voltage, power loss, the active and reactive power of every line are evaluated. For the principle of reactive power loss reduction and voltage enhancement in distribution network, the DGs are located at optimal locations using smart controller. Finally, the effectiveness of the proposed smart controller is validated with other meta-heuristic algorithms such as particle swarm optimization (PSO) and bat algorithms.

Fig. 3
figure 3

Single line diagram of IEEE 30 bus system

Table 1 shows the typical values considered for different parameters in various optimization algorithms applied in the design of smart controller.

Table 1 The algorithm parameters

To validate the effectiveness of the proposed smart controller on IEEE 30 bus test system, a randomly varying 24 h load pattern for a typical day is considered as shown in Fig. 4. Initially, the load flow program is run for IEEE 30 bus system with base case load data using Newton–Raphson method. The load flow solution, i.e., bus voltage magnitude, real power and reactive power generation/load obtained for the above test system is shown in Table 2

Fig. 4
figure 4

Daily load curve

Table 2 Load flow solution of IEEE 30 bus system using Newton–Raphson method

The line flows and line losses in various branches are evaluated from load flow solution. The total active power generation is 297.663 MW, and reactive power generation is 153.944 MVAr. From the obtained result of total generation load and line losses, it is inferred that load generation balanced equation is satisfied for both active power and reactive power, as evident from Table 2.

For the IEEE 30 bus test system under consideration, DG units are placed at generator busses (DG1 at bus 1, DG2 at bus 2, DG3 at bus 5, DG 4 at bus 8, DG5 at bus 11 and DG6 at bus 13). PSO algorithm is applied to obtain optimal sizing of DG units placed at identified locations for varying load pattern as depicted in Fig. 4. Table 3 gives the total real power loss obtained with and without DG placement obtained by PSO algorithm.

Table 3 Analysis of power losses with DG for varying load demand using PSO algorithm

The real and reactive power line losses for base case load condition for IEEE 30 bus system when evaluated using PSO algorithm was found to be 10.886 MW and 43.074 MVAr, respectively. After placing DG units with optimal sizing, real and reactive power losses evaluated for each load scenario are shown in Table 3. The average real power losses are evaluated as 11.85 MW without DG and 9.66 MW with DG placement. Hence, it identified that real power loss reduces after DG placement with suitable sizing in the identified locations.

Now similarly, bat algorithm is applied to obtain optimal sizing of DG units placed at identified locations for varying load pattern (as referred from Fig. 4) already considered for PSO algorithm. The line losses for base case load condition for IEEE 30 bus system are evaluated as 8.556 MW and 34.389 MVAr using bat algorithm. After placing DG units with optimal sizing, the power losses are evaluated for each load scenario as shown in Table 4. The average real power losses are evaluated as 11.4592 MW without DG and 7.3971 MW with DG placement. Hence it identified that average real power loss reduces after DG being placed with suitable sizing in the identified locations. Further, compared to results of PSO algorithm, the bat algorithm is found to reduce the average value of real and reactive power losses considering all load scenarios.

Table 4 Analysis of power losses with DG for varying load demand using bat algorithm

Now the proposed smart controller which is an integration of elephant herd optimization (EHO) and firefly (FF) algorithm is implemented for the IEEE 30 bus test system with DG placement for varying load patterns. The optimal sizing of DG units for each load pattern is simulated using smart controller, and load losses are evaluated as shown in Table 5. Compared to PSO and bat algorithm, it has been observed that the proposed smart controller reduces average power loss to 11.4592 MW without DG placement and 7.3971 MW after DG placement.

Table 5 Analysis of power losses with DG for varying load demand using proposed smart controller

The convergence characteristics obtained for PSO, Bat and proposed Smart Controller algorithms are shown in Fig. 5. It is seen that the proposed algorithm (represented by blue color) has a faster convergence rate and provides optimal solution in minimum number of iterations compared to the PSO and bat algorithms. This proves the efficacy of the proposed smart controller and its feasibility for real-time implementation.

Fig. 5
figure 5

The convergence comparison with the different technique

Table 6 shows the analysis of various optimization algorithms applied for demand side management problem in smart grid. About 50 independent trials were performed for each optimization algorithm. The mean and standard deviation obtained from the global solution of these trials and the best and worst case solution obtained from the trials yielding best and worst fitness value are pictured in Table 6. From the results shown in Table 6, it is inferred that PSO algorithm and proposed smart controller using EHO–FF algorithm prove a better consistency in terms of better mean value and less standard deviation.

Table 6 Analysis of optimization algorithms—IEEE 30 bus test system

4.1 Comparison of results using NR, PSO, Bat and proposed smart controller methods

A detailed comparative analysis for the results obtained for IEEE 30 bus test system without and with DG units installed using various algorithms such as conventional NR method, PSO algorithm, bat algorithm and proposed smart controller is described in Table 7. From Table 7, it is well inferred that the power loss both real and reactive power is minimized for base case load condition in the case of smart controller algorithm. Further, after placing the DG units also, the smart controller gives minimum real power loss compared to the other algorithms.

Table 7 Comparative analysis—IEEE 30 bus test system

From the converged results of the various optimization algorithms namely conventional Newton–Raphson, PSO algorithm, bAT algorithm and the proposed EHO–FF algorithm, the system voltage profile at various buses of the test system is computed. The comparative analysis of the voltage profile obtained for various algorithms is shown in Fig. 6a. It is inferred from Fig. 6a that proposed algorithm proves to improve the voltage profile at all the buses when compared to the other algorithms. Further, it is also observed that the voltage profile at the generator buses has been significantly improved in the proposed algorithm. The average voltage profile improvement including all the buses for the proposed algorithm is estimated as 1.02pu.

Fig. 6
figure 6

a Comparative analysis of voltage profile. b Comparative analysis of total real power loss

In a similar fashion, the total real power loss estimated for the 24 h load pattern (as given in Fig. 4) with DG placement for various algorithms is shown in Fig. 6b. It is inferred from Fig. 6b that there is significant reduction in real power loss when the proposed algorithm is used. Further, the average index of the total real power loss for the proposed algorithm is calculated as 7.39 MW which is reduced when compared to other algorithms as evident from Table 6. Thus, a significant improvement in the bus voltage profile and reduction in real power loss is obtained by proposed smart controller.

Based on the comparative analysis, the proposed smart controller technique is found better than the existing techniques and is validated through suitable results. It can be, therefore, concluded that the proposed smart controller algorithm is more efficient in optimizing the reactive power in smart grid environment and enhances the performance of the demand response in different power sectors.

5 Conclusion

This work has presented the design and development of a new algorithm called smart controller for demand side management in smart grid. The demand side management in the proposed smart controller formulated as optimization problem with inclusion of all operative constraints has been presented. The smart controller incorporates EHO–FF algorithm for optimal sizing of DG units paced at identified locations in the test system. To show the robustness of the proposed method, IEEE 30 bus test system has been considered with 24 h varying load pattern. The results obtained with the proposed smart controller are verified and compared with other meta-heuristic algorithms such as PSO and bat algorithm. The simulation results have proven that the proposed smart controller with DG units minimizes the real power loss and also improves the voltage profile significantly. Thus, the proposed controller shows better performance in meeting the constraints and saving time compared to the other existing methods. The proposed work addresses only the loss reduction and voltage profile improvement in the smart grid. The cost analysis such as production cost and DG cost has not been considered in the present work and is seen as the limitation. As a future scope of work, the optimization problem can be reformulated to include various cost functions and its associated constraints and can be solved by the proposed smart controller.