1 Introduction

1.1 Motivation

Modern power systems are operated close to their stability limits, and disturbances may cause loss of stability. This paper presents an effective coordination between optimal load shedding and optimal location and size of TCSC using developed MSA to prevent the voltage collapse and enhance power system stability.

1.2 Literature Review

Contingency situation in power systems can be a consequence of generation loss, sudden increase in system demand, unexpected outage of generator or transmission line, inadequate reactive power supplied to the system and the violated system constraints and operational limits. Hence, proper management and certain control actions are performed in order to restore system back to normal state. FACTS devices are considered one of the most important control strategies. These devices have many advantages such as reducing the operation and transmission investment costs, improving the transient and dynamic stability, reducing the active and reactive power losses, enhancing the voltage stability, increasing the power transfer capability, overcoming the problem of voltage fluctuations and enhancing the power quality of electric energy (Gaur and Mathew 2018). The main problem in power system operation is the lack of reactive power supplied to load which leads to voltage collapse or voltage instability. FACTS devices can supply reactive power to the system. Enhancement of static and dynamic performance of power system based on optimal allocation of multitype FACTS devices using BBO, PSO, WIPSO has been presented in Kavitha and Neela (2018). In Ghahremani and Kamwa (2013), power system loadability has been improved based on optimal allocation of FACTS devices using generic graphical user interface. In Rambabu et al. (2011), voltage profile improvement and power system losses reduction have been achieved using multitype FACTS devices. These devices have the ability to relieve or mitigate the overloading and congestion at normal operation and during emergency states (Gad et al. 2012). FACTS devices can be divided into three types: shunt, series and combined series and shunt controllers. Thyristor-controlled series capacitor (TCSC) is an elegant type of FACTS device that is connected in series with the transmission lines. TCSC is used to provide inductive or capacitive reactance. TCSC is used to inject voltage in series with transmission line (Akter et al. 2012). The determination of the best placement and sizing of TCSC devices is an urgent task to improve the performance of power systems. Hence, many researchers have launched massive scientific efforts to solve this problem. In Sundar and Ravikumar (2012), the optimal allocation of TCSC has been determined under normal and abnormal operation conditions to augment power system security. Elimination and management of congestion which occurred in transmission lines by FACTS devices and generation rescheduling have been determined using genetic algorithm in Sivakumar and Devaraj (2015). In Raj and Bhattacharyya (2017), the location and sizing of TCSC and SVC have been determined to solve the reactive power planning problem using WOA. Improvement in power flow security under normal and contingency states using optimal placement of TCSC has been presented in Duong et al. (2013). Evolutionary optimization techniques have been used to determine the optimal location and rating of TCSC in order to minimize transmission loss and improve the voltage profile (Agrawal et al. 2018). In Muisyo et al. (2015), the TCSC has been optimally installed in power system and used in congestion management. Optimal investment on TCSC considering contingencies base and N − 1 contingency states has been executed to reduce the generation cost and mitigate the congestion (Zhang et al. 2016). Optimal setting of TCSC has been determined using flower pollination algorithm in order to address problems of power system such as line loss, security, voltage stability (Pravallika and Rao 2016). Optimal placement of TCSC using gravitational search algorithm has been executed in order to enhance the power system performance involving wave generator (Attia et al. 2016). Optimal location and rating of TCSC have been used to minimize the fuel cost using GA–DOE (Apribowo 2018). Optimal allocations of TCSC and SVC have been determined using GWO to reduce the transmission line loss and enhance the voltage profile (Anusuya Devi and Niramathy 2015). Enhancement of power system security under single-line contingency based on optimal allocation of TCSC using evolutionary optimization technique has been presented in Rashed et al. (2008). Optimal placement of TCSC and SVC using NSPSO has been implemented to minimize the power loss and load voltage deviation and improve the static voltage stability margin (Benabid et al. 2009). In Irinjila et al. (2018), rating and location for different types of FACTS devices have been determined to reduce the power system losses. Another control action used at emergency or contingency conditions is load shedding. Optimal load shedding is considered as ultimate emergency action to prevent tripping and blackout for power systems (Mostafa et al. 1996). It is defined as amount of load that must be removed from a power system in order to reach new equilibrium state. The process of load shedding targets the elimination of overloading from the power system during the situation of inequilibrium between load demands and power availability (Raghu and Manjunatha 2017). Power system may be identified to be operated in three states; preventive state which is normal operating condition, emergency state occurred when some of the components operating limits are violated or some of the states outside the acceptable ranges, system frequency starts to decrease. The control objective in the emergency state is to relieve system stress by appropriate actions. Several load shedding schemes have been implemented during contingency situations either in transient or in steady state (Hajdu et al. 1968). Optimal steady-state load shedding is formulated to minimize the sum of squares of the difference between the connected active and reactive loads and the supplied active and reactive power. The supplied power is a function in the bus voltage magnitude. Voltage-dependent load model is used to express active and reactive power demands. A method of load shedding has been proposed with the objective of minimizing the amount of load shedding by Newton–Raphson technique and Kuhn–Tucker theorem (Hajdu et al. 1968). In Moazzami et al. (2016), a combined unified power flow controller and load shedding problem has been presented using (HICA–PS) method. Optimal steady-state load shedding has been achieved using SFLA during generation and contingency in power system (Mageshvaran et al. 2015). IHSA has been proposed to minimize the amount of load shed during contingency state (Mageshvaran and Jayabarathi 2015). Optimal load shedding using TLBO has been achieved to alleviate overloading for transmission lines based on the sensitivity of severity (Arya and Koshti 2014). An optimal load shedding strategy has been performed for avoiding the voltage instability in power system under emergency state (Raj and Sudhakaran 2010). Optimal load shedding can help in preventing blackout, voltage collapse, and voltage instability. FACTS devices and load shedding using extended quadratic interior point technique to relieve congestion from power system have been investigated in Elango and Paranjothi (2011). Combination of load shedding and FACTS devices has been achieved to overcome the restrictions of overloading (Etingov 2005). Minimization of load curtailment by optimal location of unified power flow controller has been achieved in Singh et al. (2016). The critical lines in power systems can be identified based on the amount of optimal load shedding (Liu et al. 2017).

1.3 Contributions

This paper proposes a coordination of optimal load shedding and optimal allocation of TCSC under normal and contingency states using a new robust and effective technique, called moth swarm algorithm (MSA). The optimal load shedding is executed by squaring the difference between the connected and supplied power (active and reactive). Single- and multiobjective functions are considered to remove or mitigate congestion and emergency situations of power system. The main objectives of the proposed algorithm are (1) minimization of the total amount of load to be shed, (2) minimization of active power loss, (3) improvement in voltage profile and (4) improvement in voltage stability.

1.4 Paper Organization

The rest of this paper is organized as follows. Section 2 presents the modeling of TCSC. Section 3 presents the mathematical formulation of OPF and studied objective functions. Section 4 presents the concept of developed MSA and its mathematical formulation. Section 5 presents the results of the selected case studies. Finally, the conclusions are written in Sect. 6.

2 Modeling of TCSC

Thyristor-controlled series capacitor (TCSC) is a capacitive reactance compensator that consists of a series capacitor bank shunted by a thyristor-controlled reactor as shown in Fig. 1. It provides a smoothly variable series capacitive reactance. The reactance of TCSC can be adjusted depending on firing angle \( \left( \alpha \right) \). It can increase power transfer capability, stability limit and voltage profile. This reactance may by capacitive or inductive. The reactance of the transmission line can be increased or decreased according to the TCSC operation mode (inductive or capacitive mode). In this paper, the TCSC is modeled as a variable reactance which can inject or absorb reactive power from the system. This model does not create change in original admittance and Jacobian matrices. The rating of the reactance of TCSC can be \( - \,0.8X_{\text{line }} \;\;{\text{to}}\;\; 0.2X_{\text{line }} \) (Sakr et al. 2016). The optimal location of TCSC is determined based on power flow analysis, where all lines are allowed to locate TCSC except those connected with transformers (Gitizadeh and Kalantar 2009). Adding TCSC in a line connected between buses i and j changes the susceptance matrix. The bus admittance matrix is changed due to the existence of TCSC. The equivalent circuit of TCSC is shown in Fig. 2. The parameter of the TCSC model can be estimated during the iterative process. TCSC implementation is considered a simple and effective way for reducing the transmission line loss and the amount of load shedding in normal and contingency operation conditions. The equivalent reactance of the line can be calculated as:

$$ X_{\text{total}} = X_{\text{line}} + X_{\text{TCSC}} $$
(1)

where \( X_{\text{total}} \) is the total reactance of the line, \( X_{\text{line}} \) is the reactance of the line and \( X_{\text{TCSC}} \) is the reactance of TCSC.

Fig. 1
figure 1

Schematic diagram of TCSC

Fig. 2
figure 2

Equivalent circuit of TCSC

3 Mathematical Formulation of Load Shedding Considering TCSC Model

In this section, the mathematical formulation of nonlinear optimization problem for load shedding with TCSC is presented.

3.1 Objective Functions

3.1.1 Single-Objective Functions

Case 1: Minimization of load shedding

In this case, the objective function is minimizing the total amount of load shedding as given in the following equation:

$$ f_{1} = \hbox{min} \left[ {\mathop \sum \limits_{i = 1}^{\text{NB}} \alpha_{i} \left| {P_{di} - \overline{{P_{di} }} } \right|^{2} + \mathop \sum \limits_{i = 1}^{\text{NB}} \beta_{i} \left| {Q_{di} - \overline{{Q_{di} }} } \right|^{2} } \right] + {\text{Penalty}} $$
(2)

where \( \alpha_{i} \), \( \beta_{i} \) are weight factors.

Case 2: Minimization of active power loss

The transmission line active power loss can be calculated from load flow analysis. It is a function of voltage magnitude and phase angle of system buses, which can be defined as:

$$ f_{2} = \hbox{min} \left[ {\mathop \sum \limits_{k = 1}^{{N_{\text{TL}} }} G_{K} \left( {V_{i}^{2} + V_{j}^{2} - 2V_{i} V_{j} \cos \alpha_{ij} } \right)} \right] + {\text{Penalty}} $$
(3)

where \( G_{K} \) is the conductance of the kth branch connected between the ith and jth buses, \( N_{\text{TL}} \) is the number of transmission lines and \( \alpha_{ij} \) is the admittance angle of transmission lines.

Case 3: Voltage Stability enhancement

Voltage stability can be defined as the ability of power system to preserve the voltages at all buses within limits after undergoing disturbance from initial operating state. Many problems lead to voltage instability including the load demand increasing, outage of one component of power system, etc. All these problems may lead to voltage collapse. Consequently, improvement in voltage stability of power system is important for planning and operation. Many different methods are used for estimating the voltage stability. L-index calculation of each bus is considered a good indicator to assess the voltage stability (Bhattacharya and Chattopadhyay 2011). It can be calculated based on load flow solution, where its value varies from 0 (no load case) to 1 (voltage collapse) (Devaraj and Roselyn 2010):

The relation between current and voltage can be expressed as:

$$ I_{\text{bus}} = Y_{\text{bus}} \times V_{\text{bus}} $$
(4)

with separation of PQ and PV buses described in the following equation:

$$ \left[ {\begin{array}{*{20}c} {I_{\text{G}} } \\ {I_{\text{L}} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {Y_{\text{GG}} } & {Y_{\text{GL}} } \\ {Y_{\text{LG}} } & {Y_{\text{LL}} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {V_{\text{G}} } \\ {V_{\text{L}} } \\ \end{array} } \right] $$
(5)

where \( I_{\text{G}} , I_{\text{L}} \;{\text{and}}\; V_{\text{G}} \), \( V_{\text{L}} \) represent the currents and voltages at generator and load buses.

$$ F_{\text{LG}} = - \left[ {Y_{\text{LL}} } \right]^{ - 1} \times \left[ {Y_{\text{LG}} } \right] $$
(6)

The L-index of jth node can be given as:

$$ L_{j} = \left| {1 - \mathop \sum \limits_{i = 1}^{Ng} F_{ji} \frac{{V_{i} }}{{V_{j} }}} \right|\quad j = 1,2, \ldots ,NL $$
(7)

L-index is estimated for all PQ buses. \( L_{\text{max} } \) describes the stability of the system, and lower value of \( L_{\text{max} } \) represents more stable system.

The maximum value of the L-index \( \left( {L_{\text{max} } } \right) \) is determined as follows:

$$ f_{3 } = L_{\text{max} } = \hbox{max} \left( {L_{j} } \right) \quad j = 1, 2, \ldots ,NL + {\text{Penalty}} $$
(8)

Case 4: Voltage profile enhancement

Improvement in the voltage profile can be achieved by minimizing the voltage deviations of load buses. However, this objective function can be formulated as follows:

$$ f_{4} = \hbox{min} \mathop \sum \limits_{i = 1}^{\text{NPQ}} \left| {\left( {V_{i} - V_{\text{ref}} } \right)} \right| + {\text{Penalty}} $$
(9)

3.1.2 Multi-objective Functions

Case 5: Minimization of load shedding, power losses and L -index

The main task of this objective function is to minimize the load shedding, active power losses, L-index simultaneously as:

$$ f_{5} = \hbox{min} \left[ {\mathop \sum \limits_{i = 1}^{\text{NB}} \alpha_{i} \left| {P_{di} - \overline{{P_{di} }} } \right|^{2} + \mathop \sum \limits_{i = 1}^{\text{NB}} \beta_{i} \left| {Q_{di} - \overline{{Q_{di} }} } \right|^{2} } \right] + \rho_{1} L_{\text{max} } + \rho_{2} P_{\text{losses}} + {\text{Penalty}} $$
(10)

where \( \alpha_{i} , \beta_{i} , \rho_{1} ,\rho_{2} \) are weight factors and \( L_{\text{max} } \) is the maximum value of L-index.

Case 6: Minimization of load shedding, power losses and L-index at contingency condition

A contingency is considered the outage of a generator, transformer or transmission line. The system may become unstable and enter an insecure state when a contingency occurs. Contingency analysis studies the impact of contingency on line power flow and bus voltage (Fauziah 2017). Contingency analysis consists of two types: simple as outage of one generator, transformer or transmission line, and complex as outage of two components as outage line and generator. In this paper, the simple contingency analysis is implemented (outage generation unit at bus #2). This objective function is the same as the previous one but it is achieved during outage of generator at bus # 2.

3.2 Constraints of OPF Problem

Equality and inequality constraints are considered for solving the proposed OPF problem.

3.2.1 Equality Constraints

Active and reactive power balance equations are considered as follows:

$$ P_{Gi} - P_{Di} - \mathop \sum \limits_{j = 1}^{\text{NB}} \left| {V_{i} } \right|\left| {V_{j} } \right|\left( {G_{ij } \cos \left( {\delta_{i } - \delta_{j} } \right) + B_{ij} \sin \left( {\delta_{i } - \delta_{j} } \right)} \right) = 0 $$
(11)
$$ Q_{Gi} - Q_{Di} - \mathop \sum \limits_{j = 1}^{\text{NB}} \left| {V_{i} } \right|\left| {V_{j} } \right|\left( {G_{ij } \sin \left( {\delta_{i } - \delta_{j} } \right) + B_{ij} \cos \left( {\delta_{i} - \delta_{j} } \right)} \right) = 0 $$
(12)

3.2.2 Inequality Constraints

These constraints represent the generator and security constraints. They include the operational limits of power system such as active and reactive power generations, bus voltage magnitudes and angles, transmission line loading as:

$$ P_{Gi}^{\text{min} } \le P_{Gi} \le P_{Gi}^{\text{max} } \quad i = 1, \ldots NG $$
(13)
$$ Q_{Gi}^{\text{min} } \le Q_{Gi} \le Q_{Gi}^{\text{max} } \quad i = 1, \ldots NG $$
(14)
$$ V_{i}^{\text{min} } \le V_{i} \le V_{i}^{\text{max} } \quad i = 1, \ldots NG $$
(15)
$$ S_{Li} \le S_{Li}^{\text{max} } \quad i = 1, \ldots LN $$
(16)
$$ - 0.8x_{l} \le x_{\text{TCSC}} \le 0.2x_{l} $$
(17)

To retain these variables at admissible limits, penalty function given in (18) should be used:

$$ {\text{Penalty function}} = {\text{fitness function}} + \alpha_{p} \left( {p_{G1} - p_{G1}^{\text{limit}} } \right)^{2} + \alpha_{v} \mathop \sum \limits_{i = 1}^{NL} \left( {v_{li} - v_{li}^{\text{limit}} } \right)^{2} + \alpha_{Q} \mathop \sum \limits_{i = 1}^{NG} \left( {Q_{li} - Q_{li}^{\text{limit}} } \right)^{2} + \alpha_{s} \mathop \sum \limits_{i = 1}^{NL} \left( {s_{li} - s_{li}^{\text{limit}} } \right)^{2} $$
(18)

where \( \alpha_{p} ,\alpha_{v} ,\alpha_{Q,} \alpha_{s} \) are a penalty factors and \( b^{\text{limit}} \) is the limit value of the state variables \( b \) given as:

$$ b^{\text{limit}} = \left\{ {\begin{array}{*{20}l} {b^{\text{max} } } \hfill & {{\text{if}}\;\; b > b^{\text{max} } } \hfill \\ {b^{\text{min} } } \hfill & {{\text{if}}\;\; < b^{\text{min} } } \hfill \\ \end{array} } \right. $$
(19)

4 Moth Swarm Algorithm

In Mirjalili (2015), a novel nature-inspired optimization called moth flame optimization (MFO) algorithm has been proposed. This algorithm is inspired from the moth searching for food, and using navigation technique in nature is called transverse orientation. Moths fly at night according to constant angle relative to the moon. Moth swarm algorithm (MSA) has been proposed in 2017 (Mohamed et al. 2017) as a developed version of MFO algorithm. The position of light represents the optimal solution, and luminosity of this light represents the objective function. This algorithm consists of three groups of moths which might be characterized as: (1) pathfinders: the main task of this group is to find new areas of optimization space and discover the best position as light source and guide the other members to this position, (2) prospectors: this group of moths are responsible for peddling into random spiral paths set by pathfinders and (3) onlookers: this group of moths drift directly toward the moonlight (global solution) determined by prospectors. During the iterative process, each moth is used to find the luminescence intensity according to the corresponding light source. Pathfinders’ positions are taken as the best fitness values, while the second and third best fitnesses are prospectors and onlookers, respectively. However, MSA can be achieved according to the following stages:

4.1 Stage of Initialization

The initial position of moths is selected randomly as:

$$ \begin{aligned} X_{ij} & = {\text{rand}}\left[ {1,0} \right] \times \left( {X_{j}^{\text{max} } - X_{j}^{\text{min} } } \right) + X_{j}^{\text{min} } \\ & \quad \forall i \in \left\{ { 1,2, \ldots ,n} \right\},\quad j \in \left\{ {1,2, \ldots ,d} \right\} \\ \end{aligned} $$
(20)

where n is the number of populations and d is the dimension of the problem. After initialization, the type of moth in the swarm is chosen based on the calculation of objective function. The best value of the objective function is selected to be pathfinders, and others are selected to be prospectors and onlooker.

4.2 Stage of Reconnaissance

In this stage, the pathfinders are committed to finding the congested area and flying for long distance to update the positions through the following five steps. In the first step, a proposed diversity index is used to choose the crossover points. At t iteration, the normalized dispersal degree \( \sigma_{j}^{t} \) in the jth dimension is calculated as:

$$ \sigma_{j}^{t} = \sqrt{\frac{{\frac{1}{{N_{\text{p}} }}\sum_{i = 1}^{{N_{\text{p}} }} \left( {X_{ij}^{t} - X_{j}^{{\bar{t}}} } \right)^{2} }}{{X_{j}^{{\bar{t}}} }}} $$
(21)

The variation coefficient can be calculated as

$$ X_{j}^{{\bar{t}}} = \frac{1}{{N_{\text{p}} }}\mathop \sum \limits_{i = 1}^{{N_{\text{p}} }} X_{ij}^{t2} $$
(22)

where \( N_{\text{p}} \) is the number of pathfinders:

$$ \mu^{t} = \frac{1}{d}\mathop \sum \limits_{j = 1}^{d} \sigma_{j}^{t} $$
(23)

where \( \mu^{t} \) is the variation degree of the relative dispersion.

Pathfinders have a low degree of dispersion which is inserted in crossover point group \( c_{\text{p}} \):

$$ {\text{if}}\;\; \sigma_{j}^{t} \le \mu^{t} \quad j \in c_{\text{p }} $$
(24)

In the second step, Lévy flights are random processes with \( \alpha \)-stable distribution that have ability to travel large distances using different step sizes. Mantegna’s algorithm (Mantegna 1994) is used to emulate the stable distribution by generating random samples \( L_{i} \) which have the same behavior as the Lévy flights as follows:

$$ L_{{i\sim{\text{step}}\, \oplus\, {\text{Levy}}\left( \alpha \right)\sim0.01 \frac{u}{{\left| {y^{1/\alpha }} \right|}}}} $$
(25)

where step is the scaling size related to the scales of the problem, ⊕ is the entrywise multiplications and \( u = N\left( {0,\sigma u^{2} } \right) \) and \( u = N\left( {0,\sigma y^{2} } \right) \) are two normal stochastic distributions:

$$ \sigma u = \left[ {\frac{{\varGamma \left( {1 + \alpha } \right) \sin \alpha \pi /2 }}{{\varGamma \left( {1 + \alpha } \right)/2\alpha 2{\raise0.7ex\hbox{${\left( {\alpha - 1} \right)}$} \!\mathord{\left/ {\vphantom {{\left( {\alpha - 1} \right)} 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}}}}} \right]^{{{\raise0.7ex\hbox{$1$} \!\mathord{\left/ {\vphantom {1 \alpha }}\right.\kern-0pt} \!\lower0.7ex\hbox{$\alpha $}}}} \quad {\text{and}}\quad \sigma y = 1 $$
(26)

The third step is known as difference vectors Lévy mutation, and the subtrial vectors are created by host vectors and donor vectors

The crossover operation is executed out, and hence the trial solution \( v_{pj}^{t} \) can be given as:

$$ v_{pj}^{t} = \left\{ {\begin{array}{*{20}l} {v_{pj}^{t} } \hfill & {{\text{if}}\;\;j \in c_{\text{p}} } \hfill \\ {x_{pj}^{t} } \hfill & {{\text{if}}\;\; j \notin c_{\text{p}} } \hfill \\ \end{array} } \right. $$
(27)

In the fourth step, each pathfinder updates its position using adaptive crossover.

The final step is called selection strategy; after the previous operation is completed, the fitness value of subtrial is estimated and the host solutions are compared, and then, the best solution is chosen to survive the next generation as follows:

$$ x_{p}^{{\overrightarrow {t + 1} }} = \left\{ {\begin{array}{*{20}l} {x_{p}^{{\vec{t}}} \quad {\text{if}}\;\; f\left( {v_{p}^{{\vec{t}}} } \right) \ge f\left( {x_{p}^{{\vec{t}}} } \right)} \hfill \\ {v_{p}^{{\vec{t}}} \quad {\text{if}} \;\;f\left( {v_{p}^{{\vec{t}}} } \right) < f\left( {x_{p}^{{\vec{t}}} } \right) } \hfill \\ \end{array} } \right. $$
(28)

The probability value of the solution Pb is calculated as:

$$ {\text{Pb}} = \frac{{{\text{Lit}}_{{\text{fit}}} }}{{\sum_{p = 1}^{{\text{Np}}} {\text{Lit}}_{{\text{fit}}} }} $$
(29)

where \( {\text{Lit}}_{\text{fit}} \) is the luminosity of the light which is calculated from fitness function of the problem \( f_{b} \) as:

$$ {\text{Lit}}_{\text{fit}} = \left\{ {\begin{array}{*{20}l} {\frac{1}{{1 + f_{b} }} \quad \;{\text{for}}\;\; f_{b} \ge 0} \hfill \\ {1 + \left| {f_{b} } \right| \quad {\text{for}}\;\; f_{b} < 0} \hfill \\ \end{array} } \right. $$
(30)

4.3 Stage of Transverse Orientation

The moths that have less luminosity of light are considered prospectors, and their numbers \( N_{s} \) decrease based on iteration and are calculated as follows:

$$ N_{s} = {\text{round}} \left( {\left( {n - N_{\text{p}} } \right) \times \left( {1 - \frac{t}{T}} \right)} \right) $$
(31)

where \( N_{p} \), \( T \) are the numbers of pathfinders and iterations, respectively.

The numbers of prospectors are updated with respect to spiral flight path as follows:

$$ x_{i}^{t + 1} = \left| {x_{i}^{t} - x_{p}^{t} } \right| \cdot e^{\theta } \cdot \cos 2\pi \theta + x_{p}^{t} $$
(32)

In (32), the method of spiral path of MFO (Liu et al. 2017) is used but with some modifications to suit each moth and the flames (light source) are selected based on probability (Pb) in (29) to enhance the capability of exploitation.

Here, \( \theta \in \left[ {a,1} \right]\, a \) is a random number which is estimated as:

$$ a = - 1 + \frac{g}{G} $$
(33)

The prospector that has better luminosity than the exiting pathfinder is considered a new pathfinder.

4.4 Stage of Celestial Navigation

At this stage, the number of prospectors is decreased and number of onlookers is risen. Moth that has low objective function is considered the onlooker and is calculated as:

$$ N_{\text{o}} = n - N_{s} - N_{\text{p}} $$
(34)

The onlooker consists of the two following groups:

1. First group fly according to Gaussian distribution with size \( N_{\text{G}} = {\raise0.7ex\hbox{${N_{\text{o}} }$} \!\mathord{\left/ {\vphantom {{N_{\text{o}} } 2}}\right.\kern-0pt} \!\lower0.7ex\hbox{$2$}} \)

$$ f\left( q \right) = \frac{1}{{\sqrt {2\pi uG} }}\exp \left( { - \frac{{\left( {q_{u} } \right)^{2} }}{{2\sigma^{2}_{\text{G}} }}} \right) - \infty < q < \infty \quad \left( {q\;\sim\;N\left( {\mu ,\sigma^{2}_{\text{G}} } \right)} \right) $$
(35)
$$ x_{i}^{t + 1} = x_{i}^{t} + \varepsilon_{1} + \left[ {\varepsilon_{2} \times {\text{best}}_{\text{g}}^{t} - \varepsilon_{3} \times x_{i}^{t} } \right] \quad \forall i \in \left\{ {1,2, \ldots ,N_{\text{G}} } \right\} $$
(36)
$$ \varepsilon_{1} \sim {\text{random}}\left( {{\text{size}} \left( d \right)} \right) \oplus \left( {{\text{best}}_{\text{g}}^{t} , \frac{\log t}{t} \times \left( {x_{i}^{t} - {\text{best}}_{\text{g}}^{t} } \right)} \right) $$
(37)

where \( \varepsilon_{1} \) is the random sample from Gaussian distribution, \( {\text{best}}_{\text{g}}^{t} \) is the global best solution (moonlight) which is obtained by transverse orientation and \( \varepsilon_{2} \) and \( \varepsilon_{3} \) are random numbers that range from [0, 1] (Tables 1 and 2).

Table 1 Parameters for different techniques
Table 2 Different studied cases

2. Second group with size \( N_{A} = N_{\text{o}} - N_{\text{G}} \)

The updating equation for this group can be given as:

$$ x_{i}^{t + 1} = x_{i}^{t} + 0.001 \cdot G\left[ {x_{i}^{t} - x_{i}^{\text{min} } ,x_{i}^{\text{max} } - x_{i}^{t} } \right] + \left( {1 - {\raise0.7ex\hbox{$g$} \!\mathord{\left/ {\vphantom {g G}}\right.\kern-0pt} \!\lower0.7ex\hbox{$G$}}} \right) \cdot r_{1} \cdot \left( {{\text{best}}_{\text{p}}^{t} - x_{i}^{t} } \right) + {\raise0.7ex\hbox{${2g}$} \!\mathord{\left/ {\vphantom {{2g} {G. r_{2} .}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${G. r_{2} .}$}} \left( {{\text{best}}_{\text{g}}^{t} - x_{i}^{t} } \right) $$
(38)

where \( i \in \left\{ {1,2, \ldots ,N_{A} } \right\}. \)

\( {\raise0.7ex\hbox{${2g}$} \!\mathord{\left/ {\vphantom {{2g} {G }}}\right.\kern-0pt} \!\lower0.7ex\hbox{${G }$}} \) is the social factor,\( \left( {1 - {\raise0.7ex\hbox{$g$} \!\mathord{\left/ {\vphantom {g G}}\right.\kern-0pt} \!\lower0.7ex\hbox{$G$}}} \right) \) is the cognitive factor, \( r_{1} \) and \( r_{2} \) are random range from [0, 1], \( {\text{best}}_{\text{p}} \) is the pathfinder solution which is selected based on probability value. At the end of each iteration, each kind of moth is redefined. The solution process of optimal load shedding with optimal allocation of TCSC in power system using MSA can be summarized in the following steps:

  1. 1.

    Initialize the control variables of test system considering the size and location of TCSC.

  2. 2.

    Set the parameter of MSA as number of pathfinders, search agents and maximum iterations.

  3. 3.

    Randomly generate the initial control variables as given in (20).

  4. 4.

    Calculate the fitness function and identify the type of each moth.

  5. 5.

    New pathfinders are generated based on (24), (25) and (28), the prospectors are updated according to (32) and the onlookers are moved to their types based on (36)–(38).

  6. 6.

    Calculate the objective function for each new moth.

  7. 7.

    Steps 4–6 are repeated until the termination criterion is satisfied.

  8. 8.

    The optimal solution (moonlight) is available.

However, the above procedures of the proposed MSA with TCSC can be summarized in the flowchart in Fig. 3.

Fig. 3
figure 3

Flowchart of MSA algorithm

5 Results and Discussion

The developed MSA is implemented to solve the optimal load shedding problem considering the optimal allocation of TCSC devices. In order to test the efficiency and robustness of the developed algorithm, the standard IEEE 30-bus test system is used for different cases with various objective functions. The results obtained by the developed algorithm are compared with other well-known optimization techniques: TLBO, PSO and GWO. MATLAB-14 software has been used to execute the proposed algorithm using 2.66 GHZ, Intel core i2 processor with 4 GB RAM PC. The maximum amount of load shed is 20% of the total connected load at each bus. The optimal design parameters of MSA used in this paper are \( N_{\text{p}} \) = 7, Search agent_Number = 50, Iteration_Number = 500.

The IEEE 30-bus test system consists of 41 lines, six generators, two static capacitors, four transformers and nine VAR compensators. The total load demand of system is 283.4 MW and 126.2 MVAR. The description of this system is presented in Table 3, and more details are given in Mostafa et al. (1996).

Table 3 IEEE 30-bus test system parameter

5.1 Discussion

5.1.1 Single-Objective Functions

Case 1: Minimization of load shedding

The fitness function of this case is to minimize the amount of load shedding. Table 4 presents the optimal solutions obtained by the developed MSA and TLBO, PSO, MFO, WOA and GWO. The supplied active and reactive powers obtained by MSA are 283.4 MW and 126 MAR, respectively, which are better than those obtained by GWO (282.452 MW, 125.224 MAR), MFO (282.240 MW, 124.180 MAR) and WOA (282.243 MW, 124.821 MAR) for a connected load of 283.4. The obtained amount of load shedding is 0.0 MW for MSA, TLBO, PSO, respectively, and 2.044 MW, 4.410 MW, 4.410 MW, for GWO, MFO, WOA, respectively. This means that no load is shed in case of MSA, TLBO and PSO. Table 5 presents the optimal TCSC reactance values obtained by TLBO, PSO, GWO, MFO, WOA and MSA. From these tables, it can be observed that the TCSC reactance may be inductive or capacitive depending on its sign. When the sign is positive, TCSC absorbs reactive power, and when it is negative, the TCSC injects reactive power. Table 6 presents the active and reactive powers of loads. Figure 4a shows the convergence characteristics of the results obtained by TLBO, PSO, GWO, MFO, WOA and MSA. The obtained results show that the developed MSA has the lower amount of load shedding and better convergence characteristics compared with other algorithms.

Table 4 Comparison among different optimization techniques for single-objective function (Case 1)
Table 5 Optimal TCSC reactance values (Case 1)
Table 6 Comparison of optimal values for active and reactive loads obtained using different optimization techniques (Case 1)
Fig. 4
figure 4

Convergence characteristics of different optimization algorithms in case of single-objective function under normal operating condition: a load shedding; b power loss; c voltage stability index; d voltage deviation


Case 2: Minimization of total active power losses

The aim of this case is to decrease the total transmission line loss. Table 7 presents the optimal solutions obtained by the developed MSA, TLBO, PSO, MFO, WOA and GWO. In this case, the TCSC is allocated at line 4 and selected as capacitive reactance which can inject reactive power in system. The total active power obtained by the developed algorithm before installing TCSC is 1.9392 MW and after installing is 1.8307 MW. This means that the TCSC has the ability to enhance power system stability. The minimum total active power loss obtained by the developed MSA is 1.8307 MW which is better than that obtained by TLBO (2.7986 MW), PSO (2.7687 MW), GWO (2.0490 MW), MFO (2.7592 MW) and WOA (1.9432 MW). Table 8 presents the optimal TCSC reactance values obtained by TLBO, PSO, GWO, MFO, WOA and MSA. Table 9 presents the active and reactive power of loads. Figure 4b shows the convergence characteristic of the results obtained by TLBO, PSO, GWO, MFO, WOA and MSA. The obtained results show that the developed MSA gives the lower total active power losses compared with those obtained by the other algorithms.

Table 7 Comparison among different optimization techniques for single-objective function (Case 2)
Table 8 Optimal TCSC reactance values (Case 2)
Table 9 Comparison of optimal active and reactive loads obtained using different optimization techniques (Case 2)

Case 3: Enhancement of voltage stability

Table 10 presents the optimal solutions obtained by the developed MSA, TLBO, PSO, MFO, WOA and GWO. Table 11 presents the optimal TCSC reactance values for TLBO, PSO, GWO, MFO, WOA and MSA. Table 12 presents the active and reactive loads obtained using different optimization techniques. In this case, TCSC is allocated at line 38 and selected as capacitive reactance. The voltage stability index for developed algorithm before installing TCSC is 0.0930 p.u and after installing TCSC is 0.0863 p.u. The voltage stability index obtained by the developed MSA is 0.0863 p.u which is lower than the obtained values by TLBO (0.1005 p.u), PSO (0.1036 p.u), GWO (0.0895 p.u), MFO (0.0880 p.u) and WOA (0.0900 p.u). Figure 4c shows the convergence characteristic of the results obtained by TLBO, PSO, GWO, MFO, WOA and MSA. The results show that the lower value of voltage stability index is obtained by the developed MSA compared with those obtained by the other algorithms.

Table 10 Comparison among different optimization techniques for single-objective function (Case 3)
Table 11 Optimal TCSC reactance values (Case 3)
Table 12 Comparison of active and reactive loads obtained using different optimization techniques (Case 3)

Case 4: Improving voltage profile

The improvement in voltage profile can be achieved by minimizing the voltage deviation of PQ buses from the unity. Improving voltage profile can increase the voltage stability and enhance the system performance. Table 13 presents the optimal solutions obtained by the developed MSA, TLBO, PSO, MFO, WOA and GWO. In this case, the TCSC is allocated at line 39 and selected as capacitive reactance. The voltage deviation for the developed algorithm before installing the TCSC is 0.1167 p.u and after installing the TCSC is 0.0943 p.u. The voltage deviation for the developed MSA is reduced to 0.0943 compared with TLBO, PSO, GWO, MFO, WOA (0.1674 p.u, 0.1456 p.u, 0.1367 p.u, 0.1136 p.u, 0.1308 p.u, respectively). Table 14 presents the optimal TCSC reactance values for TLBO, PSO, GWO, MFO, WOA and MSA. Table 15 presents the active and reactive power of loads. Figure 4d shows the convergence characteristic of the results obtained by TLBO, PSO, GWO, MFO, WOA and MSA. The results show that the lower value of voltage deviation is obtained by the developed MSA compared with those obtained by the other algorithms.

Table 13 Comparison among different optimization techniques for single-objective function (Case 4)
Table 14 Optimal TCSC reactance values (Case 4)
Table 15 Comparison of active and reactive power loads obtained using different optimization techniques (Case 4)

5.1.2 Multiobjective Functions

Case 5: Minimization of amount of load shedding, total active power losses and L -index

In this case, load shedding, voltage stability index and total active power loss are implemented simultaneously to show the effectiveness of the developed MSA for multiobjective problem. Table 16 presents the optimal solutions obtained by the developed MSA, TLBO, PSO, MFO, WOA and GWO. Table 17 presents the optimal TCSC reactance values for TLBO, PSO, GWO, MFO, WOA and MSA. In this case, TCSC is allocated at line 41 and selected as reactive reactance which can absorb reactive power from the system. The total active power, voltage stability index and voltage deviation obtained by the developed algorithm before installing TCSC are 3.1772 MW, 0.1303 p.u, 0.9142 p.u, respectively, and after installing are 3.0591 MW, 0.1261 p.u, 0.9139 p.u, respectively. Table 18 presents the active and reactive power of loads, and the active power obtained by MSA is 283.150 MW, which is better than those obtained by other algorithms (282.950 MW, 283.127 MW, 282.189 MW, 282.240 MW, 283.013 MW for TLBO, PSO, GWO, MFO and WOA, respectively) for a connected load of 283.4 MW. Figure 5 shows the convergence characteristic of the results obtained from TLBO, PSO, GWO, MFO, WOA and MSA.

Table 16 Comparison among different optimization techniques for multiobjective function (Case 5)
Table 17 Optimal TCSC reactance values (Case 5)
Table 18 Comparison of active and reactive power loads obtained using different optimization techniques for multiobjective function (Case 5)
Fig. 5
figure 5

Comparison of convergence characteristics for multiobjective function under normal operating condition for Case 5


Case 6: Minimization of amount of load shedding, total active power losses and L -index during contingency state

In this case, outage for generator (80 MW) connected at bus# 2 occurs. Table 19 presents the optimal solutions obtained by the developed MSA, TLBO, PSO, MFO, WOA and GWO. Table 20 presents the optimal TCSC reactance values for TLBO, PSO, GWO, MFO, WOA and MSA. In this case, the TCSC is allocated at line 41 and selected as capacitive reactance which can inject reactive power to system. According to Table 21, the active power of loads for MSA is 283.013 MW, which is better than those obtained by other algorithms (282.828 MW, 282.772 MW, 281.233 MW, 280.366 MW, 283.024 MW for TLBO, PSO, GWO, MFO, WOA, respectively) for a connected load of 283.4 MW. The total active power and voltage stability index obtained by the developed algorithm are reduced to 4.684 MW and 0.1333 p.u, respectively, compared with before installing TCSC (4.7657 MW and 0.1349 p.u, respectively). The optimal amount of load shedding obtained by MSA is 0.1377 MW. This value is the lowest compared with that obtained by TLBO, PSO, GWO, MFO, WOA (0.1943 MW, 0.2069 MW, 8.4075 MW, 36.7416 MW, 0.2373 MW, respectively). Figure 6 shows the convergence characteristic of the results obtained by TLBO, PSO, GWO, WOA and MSA. Table 22 presents a comparison summary among MSA with TLBO, PSO, GWO, MFO and WOA.

Table 19 Comparison among different optimization techniques for multiobjective function (Case 6)
Table 20 Optimal reactance values (Case 6)
Table 21 Comparison of active and reactive power loads obtained using different optimization techniques for multiobjective function (Case 5)
Fig. 6
figure 6

Comparison of convergence characteristics for multiobjective function under abnormal operating condition for Case 6

Table 22 Comparison summary among different optimization algorithms

6 Conclusion

In this paper, coordination of optimal steady-state load shedding of power systems and optimal allocation of TCSC placement have been studied using moth swarm algorithm (MSA) as a new robust and effective technique. Different single- and multiobjective functions have been considered under normal and contingency situations. The developed MSA algorithm has been tested and investigated using IEEE 30-bus test system. Based on the obtained results, the total active power obtained by the developed algorithm before installing TCSC was 1.9392 MW and after installing was 1.8307 MW. This means that the TCSC has the ability to enhance power system stability. The obtained voltage stability index using the developed algorithm before installing TCSC was 0.0930 p.u and after installing TCSC was 0.0863 p.u. The voltage deviation before installing TCSC was 0.1167 p.u and after installing TCSC was 0.0943 p.u. The results proved that the developed MSA has significant benefits regarding the good convergence characteristics. The obtained results proved the capability of the developed algorithm in minimizing the amount of load shedding and active power losses. In addition, the voltage profile has been improved with significant reduction in voltage deviation. The proposed algorithm has been compared with WOA and MFO which are considered recent optimization techniques. In addition, the results obtained by the proposed algorithm have been compared with those obtained by other well-known optimization techniques: PSO, GWO and TLBO. The obtained results demonstrate the capability and effectiveness of the proposed algorithm for providing high-speed convergence characteristics and accuracy of optimal solutions, compared with other well-known optimization algorithms. Future work will concentrate on the coordination between optimal load shedding and other FACTS devices using recent optimization techniques.